installing Ubuntu on Virtual Box

This post will cover installing Ubuntu on Virtual Box, enabling the ssh connection from host computer to the Ubuntu in the Virtual Box, and enabling file sharing between the host computer and the Ubuntu in the Virtual Box.

1. Installing Ubuntu in Virtual box.

    a. Download Virtual Box.
    b. Download Ubuntu.
    c. Open up the downloaded Virtual Box installation file to install it.
    d. Launch Virtual Box after installation.
    e. Click New and follow through the steps to create Ubuntu virtual machine.
    f. Click Storage, click Add CD / DVD Device icon next to Controller:IDE.
    g. Browse and find the Ubuntu installtion file downloaded from step a.
    h. Click System, in the Boot Order menu, move the CD/DVD-ROM to the top.
    i. Click Start to run the Ubuntu virtual machine and it will bring up the Ubuntu installation process.
    j. Follow through the installation to install Unbuntu.

2. Enabling the ssh connection from host computer to the Ubuntu in the Virtual Box.

    a. Power off the Ubuntu virtual machine.
    b. On the VirtualBox Manager, Click Network.
    c. On the Adapter 1 tap, Select Bridged Adapter from the Attached to dropdown menu.
    d. Click OK.
    e. Start the Unbuntu virtual machine.
    f. Open up the Terminal in Unbuntu virtual machine.
    g. Run the below commands in the terminal to enable the ssh connection.

    	sudo apt-get update
    	sudo apt-get install openssh-server
    	sudo ufw allow 22
    	sudo /etc/init.d/ssh restart
    	

    h. Find the ip address by ifconfig, the ip next to inet
    i. On the host machine(Window), use putty to try to connect to virtual machine using the ip address found from last step.
    j. Restart the virtual machine and try step i again if still unable to connect.

3. Enabling file sharing between the host computer and the Ubuntu in the Virtual Box.

    a. Create a folder on the host computer for example, C:\share
    b. Start the Ubuntu virtual machine in VirtualBox.
    c. Select Devices and then Shared Folders
    d. Choose Add and browser to the folder created on step a.
    e. Check mount automatically and Make permanent.
    f. Select Devices and then Install Guest Addons.
    g. Run the below command in the terminal to find out the shared folder location in Ubuntu.

    	sudo mount | grep vbox
    	

    h. Assume ben is your user name, run the below command to add the user “ben” to the group “vboxsf”

    	usermod -a -G vboxsf ben
    	groups userName
    	

    i. Go to the folder and create a test file and the file it should also show up on the host machine location C:\share
    j. Assume the folder is mounted at “/media/sf_share”, the below command can make a link at your home diretory to point to /media/sf_share

    	ln -s /media/sf_share ~/share
    	

    k. To mount the share folder to other directory, for example mount it to “/mnt/share”, put the below line in /etc/rc.local, and restart the virtual machine.

    	 mount --bind /media/sf_share /etc/share
    	

Search within Codexpedia

Custom Search

Search the entire web

Custom Search