In this post, we will setup VirtualBox on Windows with Linux as a Guest OS. Follow the steps to begin:
Downloading and Installing VirtualBox
Download the virtual box setup from here. Under VirtualBox binaries, select package for Windows Hosts. Also, download VirtualBox Extension Pack, we will need it later for when we setup our Guest OS.
Also we need to download our favorite Linux distro. I am using Ubuntu latest version (as of this date), you can get it from here.
We will run VB setup wizard and install VirtualBox on our drive (you can specify the location where you want to install it).
Install Extension Pack
Run VirtualBox for the first time. Go to File > Preferences or use shortcut key (Ctrl + G). In the Preferences dialog box, go to Extensions.
Add the extension pack that we downloaded earlier. We can do so by either Right Click > Add Package or pressing the button (Add New Package) on the right hand side of the window.
Once weagree to the terms of conditions, we’ll able to install the extension pack.
Press Ok to close the Preferences dialog box.
Creating a New Virtual Machine
Click on New button to create a new virtual machine (VM). It will open up a wizard to create a VM. Enter the name for our VM (I’m using ‘Ubuntu 16.04.2’ same as the version of my Ubuntu). Click Next.
Select the amount of RAM we want to assign to this VM. I’ve assigned 8GB as I have 32GB but you can assign as per your preference. Click Next.
It will ask us whether we want to add virtual hard disk to this machine or not. We will make sure to select ‘Create a virtual hard disk now‘ option before we click Create button. Select the size of the hard disk and then we are done.
Installing OS on VM
Right click on the VM we just created and select Settings. In General Settings, go to Advanced tab, change ‘Shared Clipboard‘ and ‘Drag’n’Drop‘ to Bidirectional.
In Storage settings, we can see that under Controller: IDE it shows Empty. Select this Empty option and we will see that Attributes on the right hand side changes. Click on the CD icon next to the Optical Drive option and select the Choose Virtual Optical Disk File option to choose Ubuntu Iso we downloaded.
Check Live CD/DVD option below that as well. And then Press Ok to close the Settings.
Start the VM by right clicking and selecting the Start > Normal Start.
Now we can install Ubuntu on this Machine.
Setting things in Ubuntu (Guest)
Once we have installed Ubuntu on our VM, we will start it. Now go to Devices > Insert Guest Additions CD Image. It will ask to run, then enter your password to install it. Then restart Ubuntu after it is installed.
Go to Devices > Shared Folders > Shared Folders Settings. Right click and then select Add Shared Folder. Select the folder path that we want to share. Make sure you select Auto mount and Make Permanent and press Ok.
Shut down the Ubuntu OS.
Restart your VM, and voila your system is ready with Shared Folder
Note: If you get Permission denied error on accessing the shared folder, just add your username to vboxsf group using command:
sudo adduser <username> vboxsf