The following article contains the steps to setup Ubuntu in a VM. The virtualization application being used is VirtualBox on a Windows 10 host OS. This will be used for a local development environment with Git, Docker, Java, .NET Core and Node.js.
Install VirtualBox
If you do not already have VirtualBox installed then head over to their downloads page: VirtualBox downloads
Download and install the latest VirtualBox. Follow the prompts to completion. The official site does have a manual if need be. At the time of writing this, VirtualBox 5.1.30 was used.
Using Docker on Windows
If you are using Docker on Windows, please ensure that Hyper-V is disabled. VirtualBox will not work without the change.
After a restart, there will be a message from Docker which you can ignore:
It can be re-enabled if you choose to use Docker on Windows. To change this setting back: re-enable Hyper-V.
Download Ubuntu
The Linux distribution chosen for this tutorial is Ubuntu using version 16.04.3.
Visit the Ubuntu website and download the ISO image: Ubuntu downloads
Create the VM
Launch VirtualBox and click on the green ‘New’ cog icon.
1-Assign a name to the VM and select ‘Linux’ as the type and ‘Ubuntu (64-bit)’ as the version.
2-Allocate sufficient memory for the VM.
3-Create a virtual hard disk.
Keep the defaults which will be VDI (VirtualBox Disk Image). Decide which storage type will suit you best. Dynamically allocated is selected by default which will only fill up space as it is being used. The limit will be the virtual hard disk limit that is set. Ensure this is at least 10 GB.
4-A prompt will appear to select the start-up disk for the VM. This is the Ubuntu ISO image that was downloaded earlier. If for whatever reason the host disk was selected then the image can still be loaded by visiting the settings -> storage.
Setup clipboard sharing and drag and drop functionality
To make life easier, setup clipboard sharing and drag and drop functionality. This will be useful if using a GUI or needing to copy over commands to the terminal.
To set this up, go into the settings of your newly created VM -> General -> Click ‘Advanced’ and selected bidirectional for the Shared Clipboard and Drag ‘n Drop items. VirtualBox Guest Additions is the only other step required to activate this. Details are shown in part 2 together with setting up the shared drive.
There is also a snapshot folder which is the destination of VM snapshots (essentially copies at particular points in time) that VirtualBox will create.
Boot the VM
Start up the newly created VM. Follow the prompts to completion.
This concludes part 1. We now have a VM. In the next section part 2, the focus will be on shared drives and setting up development tools.