In this section, we will see how to set up Linux (Ubuntu) on a virtual machine, so that a Windows user can also develop and test their .NET Core 2.0 applications in Linux. To do so, let’s start with the VirtualBox setup. Oracle provides an open source VirtualBox executable, which we downloaded in the previous section. The following are the steps we need to follow to set up VirtualBox:
- Double-click on the VirtualBox executable. It will open a wizard. Before installation, click on Disk usage and check Disk Space Requirement. It is recommended that the virtual machine for Ubuntu Linux is set up with at least 2 GB RAM and 25 GB free hard drive space. So, instead of choosing the default drive (the C drive in our case, where Windows is installed), select another drive if it exists (for example, the D drive) so that you can easily allocate more space, and it also prevents any impact on the host operating system.
- The VirtualBox setup needs approximately 241 MB of disk space to install. It's recommended to create a new folder (for example, VirtualBox) to easily identify and track the VM.
- Keep clicking the Next button until the last page. At the end, a warning will be displayed that the installation of VirtualBox will reset the network connection and temporarily disconnect the machine from the network. This is alright if you are working on the same physical machine. So, click on the Yes button and continue, and then click on the Install button and finish the installation:
- Once the preceding installation is done, open the VirtualBox manager to create a new virtual machine. Click on New and give the Name of the machine (for example, Ubuntu, as shown), and select the Type as Linux and the Version as Ubuntu (32 bit):
- We need to specify the memory size. More memory is good, but we should consider our disk space before selecting it. A minimum of 2 GB system memory is required for Ubuntu 17.04. Select Create and then select VDI (VirtualBox Disk Image) as Hard disk file type. Select a Dynamically allocated hard disk. It will use space on your physical hard disk as it fills up (up to the maximum fixed size). Set the disk space maximum size to 25 GB and click on Create. It will create a virtual machine with the Ubuntu operating system (32-bit) and 4 GB RAM, and the full details will be displayed on the final page: