When using the Linux target module, you may want to use a virtual machine if you do not have access to a separate computer that runs the desired OS, or you do not want to dual boot your development machine. This article will show you how to set this up on Windows 8 using the Hyper_V virtualization console with the Linux Ubuntu OS (version 14.04.2 LTS). Note that your system must be SLATS enabled for Hyper-V to work, and if it is not you should be using a different virtualization program, like Virtual Box (see Set Up A Virtual Machine Using Virtual Box).
Starting The Hyper-V Console
On Windows 8, you can go to the Modern UI start menu, and click on the Hyper-V Manager live tile to start up the Windows 8 virtualization console (if you do not have this live tile, it may be that you have not enabled Hyper-V. You can do this following the instructions found here).
Once the program has started, you will see that the main window is split into various sections. On the right, is a list of commands related to your own PC, with "New" at the top. Click on that to bring up the options shown in the image below and select the "Virtual Machine" option.
Creating a Virtual Machine
If this is your first time using Hyper-V, a Before You Begin screen will appear and you can just click Next to continue. This will then bring up a screen where you can give your VM a name (something simple like "Ubuntu") and choose an alternative location to create it. This will have little impact on performance and running, so you can change this if you wish. Make sure that whatever location you choose has at least 5GB of disk space, however as Ubuntu's default installation is less only a little less than 3 GB.
Next, you can choose how much memory you want to assign to your VM. If you have 1GB or less of RAM, it is advisable that you stick with the recommended value that Hyper-V defaults to, however, if you have over 1 GB, about a quarter of 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.
This next step is one of the most important - Set up the network communications for the VM. Without a network connection, GameMaker:Studio will not be able to communicate with the VM, so make sure to select your network adapter from the drop down list here before continuing.
- NOTE: If you do not see your network adapter listed here, you will have to cancel the current set up a new Virtual Switch from the Hyper-V manual. See the section on troubleshooting below.
You should now define the properties of the VM hard drive. The Hyper-V
vhdx format permits up to 16TB to be assigned to virtual hard drives, but that's a bit excessive so choose a size that seems appropriate (at least 5GB but more would be better) then continue to the installation of your Ubuntu OS.
If you have downloaded the OS from the link given on the Setup GameMaker:Studio For Linux (Ubuntu) page, then you will have an
iso file, so you should select the option to "install an operating system from a boot CD/DVD-Rom", then check the "image file" option and browse to the image file that you downloaded from the Ubuntu site. If you have not yet downloaded the Ubuntu OS, you can get a copy from here.
The final section of this set-up wizard will show a suummary of the VM that you are going to create and if everything is correct, you can click on "Finish" to create your new VM.
It may take a few minutes for Windows to create the new VM, but once it has been created, you simply have to right click on it from the Virtual Machine pane of the Hyper-V console window and selectStart. This will start the VM, but to actually see it in a window on your desktop, you will have to double click the VM or right click and select "Connect". Once Ubuntu has booted up, you will be presented with the option to Try or Install the OS. You should choose to install the OS on the newly created virtual disk.
You now have a working copy of Ubuntu running as a VM on your Windows 8 Pc! You can continue on to the Preparing Ubuntu section of the Setup GameMaker:Studio for Linux (Ubuntu) tutorial.
Setting up Hyper-V with an Ubuntu virtual machine is quite a straight-forward procedure, but it does have one complication... setting up a network switch so that your virtual machine can communicate with the rest of your system over the network.
To set up network communication, you need create a Virtual switch that you can then "point" the new virtual machine at, but this is easily done from the Hyper-V Manager. First you should right-click on your PC from the list on the left of the main Manager window. This will bring up a series of options from which you should select virtual Switch Manager.
This will open a new window where you should click on the New Virtual Switch Network button on the left, then select External from the list of possible network switches that you can make. Finally click on the button marked Create Virtual Switch.
Your new Virtual Switch has been created, but you will now have to set the Properties of the switch, by giving it a name (something obvious like "Ubuntu Network Switch", for example) and then checking the External network as well as the Allow management operating system to share this network boxes. Finally, from the drop down list, select your network adapter and click on the Apply button at the bottom of the window.
You now have a network switch set up which can be used by Ubuntu to communicate with GameMaker:Studio.