Setup An Ubuntu Virtual Machine Using Virtual Box

For using the Linux (Ubuntu) target module, you may wish to use a virtual machine if you do not have access to a separate computer that runs the desired OS or do not wish to dual boot your development PC. This article will show you how to set this up on any Windows PC using the Virtual Box virtualization console, which you can download for free from here, along with the Linux Ubuntu OS (version 14.04.2 LTS) which you can get from here. Note that if you have a Windows 8 PC, you may be able to use the Hyper-V virtualization console instead (see Set Up An Ubuntu Virtual Machine Using Hyper V).

Creating A Virtual Machine

Install your copy of Virtual box as you would any windows program and then run it. You should click on New to indicate that you want to create a new virtual machine, and when the New Virtual Machine Wizard appears, click Next button.

You will now be presented with a screen where you can name your new VM and indicate which OS is going to be used.


You can call the machine whatever you want, but since you are installing Ubuntu, it makes sense to call it Ubuntu VM or something similar, especially if you have any other VM in use. You should also specify that the operating system is Linux, and that the version is Ubuntu.

VirtualBox will try to guess how much of your memory (or RAM) to allocate for the virtual machine. If you have 1GB or less of RAM, it is advisable that you stick with the recommendation. However, if you have over 1GB, about a quarter your RAM should be fine - For example, if you have 2GB of RAM, 512MB is fine to allocate, or if you have 4GB of RAM, 1GB is fine, but if you are not sure how much system RAM you have, just go with the default.

NOTE: If you want some half decent performance it isn't recommended giving your virtual machine anything less than 512MB of RAM, but if you can, make something like 1024MB (or higher) to get optimal performance.

Clicking next will then take you to a screen where you will be asked which virtual hard drive to use, and if you have not previously created any other virtual machines, you will want to tick the Startup disk option and select Create new hard disk.


After this, clicking next will ask you to choose the type of hard disk to create, and the default value of VDI (VirtualBox Disk Image) is fine. Clicking Next will then ask you about the storage details for the disk, which is basically asking you to choose a fixed or a dynamic disk. Theoretically, a dynamically expanding virtual hard drive is best, as it will take up only the space that you actually use. However there have been reports of issues when installing new software in a virtualized Ubuntu, where the virtual hard drive just fills up instead of expanding. Therefore it is recommended that you pick a Fixed-size storage.

The next step is to tell Virtual Box where to create your virtual drive, so make sure that the path you give points to a storage area with enough space for the disk, and then allocate your disk a size. Remember that the Ubuntu OS needs a little less than 3GB of space, so choose a size that has a few more GB than this to make sure that your VM will operate correctly.


Once you are happy that everything is set up as you want, the Next button will take you to a summary of the information supplied, and if everything is correct you can click on the Create button to create the virtual disk that will hold the Ubunto OS.

The next thing to do to make the (currently blank) virtual hard drive useful is to add the downloaded Ubuntu disk image (the .iso that you downloaded previously) so that it boots on your virtual machine. To do this, first click on Settings and then Storage. In the storage tree, select Empty and on the right there will be a button marked CD/DVD Device. Clicking that will bring up the option to choose a virtual CD/DVD disk image. When you select this, you should browse to the downloaded Ubunto iso file and click on Open, then, once back on the Settings window, click on OK at the bottom. If you have not yet downloaded the Ubuntu OS, you can get a copy from here.


You can now double-click on your new Ubuntu virtual machine to start it up. When you do, note that you may get a number of warnings/instructions about how to operate the guest operating system within VirtualBox. you do not really need to worry to much about these and may want to mark the Do not show this message again box to remove them from future uses of your VM. Once Ubuntu has booted up, you will be presented with the option to Try or Install Ubunto. You should choose to install the OS on the newly created virtual disk.


With that done, you now have a working copy of Ubuntu running as a VM on your Windows Pc! You can now continue on to the Preparing Ubuntu section of the Setup GameMaker:Studio for Linux (Ubuntu) tutorial, but please note that once you have finished preparing the OS, you should come back to Virtual Box and then change the settings one more time, to make sure that it boots from the installed OS, and not from the disk image file that you downloaded.

To do this, simply go back to the Settings menu and in the Storage tree, set the IDE Controller value back to Empty again using the Remove disk from the virtual drive option.

Have more questions? Submit a request


Article is closed for comments.