layout |
---|
default |
NOTE:
We do not have any Windows licence or Windows distribution available for you. You will need to have these yourself.
Users report these instructions work as well with Windows 10
In order to run Windows on a VM, you will need to proceed with the full installation as if it would be a local physical machine (e.g.: your laptop). But then, with the extra overhead of making the necessary adjustments so that your VM will work in the virtual environment that the HPC Cloud offers. These are the steps that we will carry out to make it work:
- Prepare the installation
- Run the Windows installation
- Configure contextualization
- Prepare your VM for production
Let us look into these steps with more detail.
NOTE:
Make sure you have your Windows ISO available in your laptop, so that you can upload it to the HPC Cloud.
In this section we will be setting up the environment within your project (or Group) space in the HPC Cloud. It involves:
- Creating an
image
that will be empty in the beginning, which will work as an empty hard drive where you will install Windows - Creating an
image
with the Windows installation media, by uploading your Windows ISO - Creating an
image
with the Virtio drivers for Windows, by fetching an ISO from the Internet - Creating a couple of
file
s on the UI by downloading them from the Internet and uploading them to the UI - Creating a
template
where you bring all these components together, which you can use to start a VM from
Analogously to your laptop, your VM needs a hard drive where the operating system can be installed and where it will live. We will create one here.
- On the UI: Go to the Images tab (under Storage), and click on the green [+] button (on the top-left corner of the screen) to start creating a new
image
. A form will pop up. - On the UI: On the form that popped up:
- type in a meaningful Name (e.g.: windows_drive, we will use this name later)
- type in a meaningful Description (optional)
- choose Type DATABLOCK
- leave Datastore with 104: local_images_ssd
- check the This image is persistent checkbox
- on the Image location: group, choose radio button Empty disk image
- and give it a Size that is meaningful to you (e.g.: our test with installing Windows 8.1 required already 10GB for Windows alone, so we filled in 20GB)
- On the UI: Click the green button Create on the form, to submit it. A new
image
will show on the Images list, and it will keep in status LOCKED while it is being created. When it is created it will come to status READY.
- On the UI: On the Images tab (under Storage), click on the green [+] button (on the top-left corner of the screen) to start creating a new
image
. A form will pop up. - On the UI: On the form that popped up:
- type in a meaningful Name (e.g.: windows_iso, we will use this name later)
- type in a meaningful Description (optional)
- choose Type Readonly CD-ROM
- leave Datastore with 104: local_images_ssd
- leave the Persistent checkbox unchecked
- on the Image location: group, choose radio button Upload; then, underneath, click on Choose file to have a dialogue pop up where you will look for the path on your laptop where you have your Windows .iso file and, finally, choose the .iso file to close the pop-up dialogue to return to the original form
- On the UI: Click the green button Create on the form, to submit it. A progress bar will show at the bottom of the screen, which will advance as the upload of your .iso file evolves. When the upload is complete, a new
image
will show on the Images list, and it will keep in status LOCKED while it is being created. When it is created it will come to status READY.
The best way to make physical hardware (namely: hard drives and network adapters) available to VMs in the HPC Cloud is by using Virtio drivers. However, Windows does not natively support those drivers, but if we make them available to the Windows installer, we will have no problem using them. This requires making them available externally, and that is what we will do in this step.
- On the UI: On the Images tab (under Storage), click on the green [+] button (on the top-left corner of the screen) to start creating a new
image
. A form will pop up. - On the UI: On the form that popped up:
- type in a meaningful Name (e.g.: virtio_drivers_iso, we will use this name later)
- type in a meaningful Description (optional)
- choose Type Readonly CD-ROM
- leave Datastore with 104: local_images_ssd
- leave the Persistent checkbox unchecked
- on the Image location: group, choose radio button Path in OpenNebula server; then, underneath, type the following URL in the Path field: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
- On the UI: Click the green button Create on the form, to submit it. A new
image
will show on the Images list, and it will keep in status LOCKED while data is being downloaded from the URL you wrote. When it is created it will come to status READY.
NOTE:
You can read more about Windows contextualization for OpenNebula here:
On the HPC Cloud, VMs use the contextualization mechanism to configure themselves. In particular, you will need to have a few files in your VM so that it can actually configure itself. We will be making those available in this step so that, at a later step, we can make your VM use them. We will make them available in the form of a windows .msi
installer, which we will feed the VM in the form of an ISO image.
- On the UI: On the Images tab (under Storage), click on the green [+] button (on the top-left corner of the screen) to start creating a new
image
. A form will pop up. - On the UI: On the form that popped up:
- type in a meaningful Name (e.g.: context_addon_iso, we will use this name later)
- type in a meaningful Description (optional)
- choose Type Readonly CD-ROM
- leave Datastore with 104: local_images_ssd
- leave the Persistent checkbox unchecked
- on the Image location: group, choose radio button Path in OpenNebula server; then, underneath, type the following URL in the Path field: https://github.com/OpenNebula/addon-context-windows/releases/download/v5.8.0/one-context-5.8.0.iso
- On the UI: Click the green button Create on the form, to submit it. A new
image
will show on the Images list, and it will keep in status LOCKED while data is being downloaded from the URL you wrote. When it is created it will come to status READY.
Extra note:
If you experience a problem in the last step (creating the image), proceed as follows:
- Download the contextualization file to your computer
- Upload the contextualization file (on the Image location: group, choose radio button Upload instead of Path in OpenNebula server)
Now that we have all components ready in the UI, we are ready to bring them together. On the HPC Cloud, we do that on a template
.
- On the UI: On the VMs tab (under Templates), click on the green [+] button (on the top-left corner of the screen) to start creating a new
template
. The page will change into the Create VM Template screen. - On the UI: On the Create VM Template screen, on the General tab:
- type in a meaningful Name (e.g.: windows_setup, we will use this name later)
- type in a meaningful Description (optional)
- choose a Logo that you like
- type in (or use arrows) 8GB of Memory
- type in (or use arrows) 1 CPU
- On the UI: On the same Create VM Template screen, on the Storage tab:
- for the Disk 0 (on the left column of the screen), choose the windows_drive
image
(from the table on the right of the screen) that you created as the firstimage
of this guide - click on the + Add another disk button (that will make a new Disk 1), and then choose the windows_iso
image
you created as a secondimage
of this guide - click again on the + Add another disk button (to make a new Disk 2), and then choose the virtio_drivers_iso
image
- click again on the + Add another disk button (to make a new Disk 3), and then choose the context_addon_iso
image
- On the UI: On the same Create VM Template screen, on the Network tab:
- for the Interface 0 (on the left column of the screen), choose the internet
network
(from the table on the right of the screen) - click on the + Add another nic button (that will make a new Interface 1), and then choose your internal
network
(it will be the only othernetwork
that you can see on the right that is not called internet)
- On the UI: On the same Create VM Template screen, on the OS Booting tab:
- check the box for the windows_iso disk, and bring it to the top of the list, by clicking the arrow-up button to the right of it
- check the box for the windows_drive disk and make it the second on the list
- On the UI: On the same Create Template screen, on the Input/Output tab:
- click on the VNC radio button
- on the Inputs group, choose Tablet on the first dropdown menu, then USB on the second dropdown menu and finally click on the Add button. A new entry will appear below those dropdowns with what you just selected.
- On the UI: We are ready defining the
template
, so click on the green Create button at the top of the screen. A newtemplate
will show on the Templates list.
We will now create a VM and run the Windows installation on it.
- On the UI: Go to the VMs tab (under Instances). Click on the green [+] button (on the top-left corner of the screen) to start creating a new VM. The page will change into the Create Virtual Machine screen.
- On the UI: On the Create Virtual Machine screen:
- choose the template you defined before (i.e.: windows_setup)
- type in a meaningful VM Name (e.g.: windows_first)
- On the UI: We are ready defining the VM, so click on the green Create button at the top of the form. A new VM will show on the Virtual Machines list. It will go through several states (e.g.: PENDING, PROLOG...) until it reaches the RUNNING state. Notice that to reach this state it can take a few minutes (circa 3' for current setup).
- On the UI: You can then start operating within your VM. Click on the screen-like button that you can see to the right of your VM on the list. It will pop-up the VNC console, so you should be able to see the welcome screen of your Windows installation.
Now you need to install Windows with custom installation, by following the steps you would normally follow. Only, with one caveat: you need to install the Virtio drivers, as pointed out before.
While running the Windows installer, you will reach a step in which you have to choose which disk (or drive) to install Windows on. It will be empty, because the disks are made available to your VM via Virtio, but you have not installed the Virtio drivers yet, so your Windows installation cannot see the disk. This is how you do it:
Note:
Since we will be installing Virtio drivers, we will be installing them for disks and for network cards. Therefore, even if after step 4 you see no actual change in the screen, that is fine. Please continue to step 5.
- On the Windows VM: At the step where you need to choose a disk on which to install Windows, click on the Load driver button (under the big white empty area). A dialogue pops up.
- On the Windows VM: On the pop-up dialogue, click on the Browse... button. A Browse for folder tree will pop-up now.
- On the Windows VM: We will start with the network interfaces driver. On the chooser tree, you will see three entries that represent three CD-ROM drives. Click on the one that holds the Virtio drivers (therefore, not the one labeled CONTEXT), and open folder
NetKVM
, then the folder that matches your Windows version, and then the 64-bit or 32-bit version depending on your Windows as well. - On the Windows VM: After you chose the folder, a pop up will show the drivers that it could locate (or click on Scan to refresh the list). Doubleclick the only entry that you should see, so that it is installed.
- On the Windows VM: Now we will repeat the process for the disks driver. On the chooser tree, you will see three entries that represent three CD-ROM drives. Click again on the one that holds the Virtio drivers (therefore, not the one labeled CONTEXT), and open folder called
viostor
, then the folder that matches your Windows version, and then the 64-bit or 32-bit version depending on your Windows as well. - On the Windows VM: Again, on the next screen, click on Scan if the list of detected drivers is not updated. Then install the driver. At this point, the originally white area shows one entry: your disk.
- On the Windows VM: You can finally click on the drive to get Windows installed on it.
You can continue with the rest of the Windows installation process normally. Then, reboot so that your newly installed Windows starts up (make sure you do not start the installation again).
Once your freshly installed Windows starts, we will configure your VM so that it auto-configures itself on start-up with the values that the OpenNebula environment has assigned to the VM (e.g.: at this point, you can see that there is no active network connection, so you cannot even browse the web).
- On the Windows VM: Open the file explorer, and browse the CD-ROM labeled one-context-5.8 (thus not the one labeled plainly CONTEXT). You should be able to see at least 4 files on that CD-ROM. When you open the CD Drive, you should see one file called one-context-5.8.0.
- On the Windows VM: Execute the file one-context-5.8.0 by doubleclicking on it. A pop-up will ask whether you want to allow the app to make changes. Clik con the Yes button. It appears as though nothing has happened, but the effect will be visible after rebooting your Windows.
- On the Windows VM: You can reboot your Windows again. Verify you have internet by opening the web browser and navigating to any web page that you may know.
- On the UI: You can now shut your VM down. Notice that OpenNebula will take some minutes to gracefuly shutdown the VM, similar time than when the VM was instantiated.
We will proceed now with the removal of all the installation media and prepare your VM for production.
Once you have installed and configured your Windows, you do not need the installation media around any more. We will make a new template
to use only the disk that we need.
In the following steps we will be referring to the the RAW data group of fields. You must make sure that the <topology>
that you set up there matches the cpu value that you set in the template. Otherwise, your VM will fail to launch!
In short, make sure that: sockets × cores × threads = cpu
- On the UI: Begin creating a new
template
the usual way. - On the UI: On the Create VM Template screen, on the General tab:
- type in a meaningful Name (e.g.: my_research_run)
- give it as much memory and as many CPU's as you need
- On the UI: On the same Create VM Template screen, on the Storage tab:
- for the Disk 0 (on the left column of the screen), choose the windows_drive
image
(from the table on the right of the screen) that you created as the firstimage
of this guide, and where you have installed Windows
- On the UI: On the same Create VM Template screen, on the Network tab:
- for the Interface 0 (on the left column of the screen), choose the internet
network
(from the table on the right of the screen) - click on the + Add another nic button (that will make a new Interface 1), and then choose your internal
network
(it will be the only othernetwork
that you can see on the right that is not called internet)
- On the UI: On the same Create VM Template screen, on the Input/Output tab:
- click on the VNC radio button
- on the Inputs group, choose Tablet on the first dropdown menu, then USB on the second dropdown menu and finally click on the Add button. A new entry will appear below those dropdowns with what you just selected.
- On the UI: On the same Create VM Template screen, on the Other tab, you want to tell Windows how to use multiple cores:
- within the RAW data group, choose for the Type dropdown menu kvm, then in the DATA textfield to the right of it, write
<cpu><topology sockets='1' cores='4' threads='1'/></cpu>
(you should replace thecores
number with the amount of them you need).
- On the UI: We are ready defining the
template
, so click on the green Create button at the top of the screen. A newtemplate
will show on the VM Templates list.
From now on, you will use this template
to run your VM.
Previously you would have to configure this by hand (see appendix further down). But running the contextualisation .msi
seems to be configuring Remote Desktop as well. So you should be able to work with Remote Desktop.
In the Prepare your VM for production section, we wrote a way to configure your VM so that Windows will understand what to do with the cores the VM has available. However, some users have reported that the following helped them instead:
<vcpu placement='static'>4</vcpu>
<cputune>
<vcpupin vcpu='0' cpuset='1'/>
<vcpupin vcpu='1' cpuset='2'/>
<vcpupin vcpu='2' cpuset='3'/>
<vcpupin vcpu='3' cpuset='4'/>
</cputune>
<cpu mode='host-passthrough'>
<topology sockets='1' cores='4' threads='1'/>
</cpu>
NOTE:
Some users report suffering from very unstable (to the point of unuseable) systems with Windows 7 running on more than 16 cores.
Having to connect to the VM via the VNC console on the web UI is somewhat tedious and rather limited, so you probably want to access your VM via Remote Desktop. Running the contextualisation .msi should have enabled Remote Desktop for you already, but if you ever need to do it bay hand, here is how you can do that:
Note:
For Windows 10 you may need to enable Remote Desktop first, by going to the Start Menu, then Preferences > Remote Desktop and flicking the swith to Active.
- In your local network: Make sure your firewall (maybe in your home router) has port 3389 open for your laptop.
- On the Windows VM: Right-click on the Windows Start button, and then choose option Run. A dialogue will pop up.
- On the Windows VM: On the dialogue that just popped up, type the following in the Open: field:
gpedit.msc
. A new window titled Local Group Policy Editor will show. - On the Windows VM: On the Local Group Policy Editor, navigate to Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Security.
- On the Windows VM: Change the following two settings (doubleclick on each of them):
- Require use of specific security layer for remote (RDP) connections from Not configured to Enabled, and then choose on the dropdown Security Layer, the value RDP.
- Require user authentication for remote connections by using Network Level Authentications from Not configured to Disabled.
- On the Windows VM: Restart your Windows.
You should now be able to connect to your VM using a Remote Desktop client.