Getting Started with Virtual Machines

From Userful Support
Jump to navigationJump to search


Copyright © 2014 Userful Corporation. All rights reserved.
(Updated 2014.04.21)


  This page is also available in:   English, Español, Français, Português, Deutsch  



Introduction

Userful's Virtual Desktop Infrastructure (VDI) solution is a feature that makes it possible to map full-screen Virtual Desktop sessions to stations.

This guide provides step-by-step instructions for installing virtual machines (VMs) to use with the Userful Virtual Desktop Infrastructure (VDI) station mapping profile. It also includes instructions for saving and copying VM Master Images, as well as very basic optimization and troubleshooting guidelines.

"Station Mapping" lets a system administrator configure what type of Virtual Desktop session to launch on each station. Once the system administrator has mapped a Virtual Desktop session to a station, it will automatically launches a full-screen session on that station.

The simple instructions provided here are sufficient for creating VMs for demonstration purposes; in production environments, system administrators should refer to either Virtual Machine Optimization guide for how to configure


Userful VDI technology relies on third-party virtual machine players (also known as "hypervisors") like Oracle® VirtualBox™ to create and configure Virtual Machines.

For deployments in production environments, Userful strongly recommends accessing the third-party documentation for detailed information, instructions and troubleshooting of VMs created with that VM player.

For example, VirtualBox has extensive online documentation.

Licensing is Your Responsibility

Please Note: You are responsible for complying with all operating system and application vendors’ license agreements when you clone a virtual machine or make it available for multiple users.

Considerations When Using Virtual Machines

  • Make sure that sufficient system resources, especially RAM, are available for all mapped stations. For example, if the master VM is 512MB, and there are 15 stations, the system must have at least 8Gigs RAM available.
  • The BIOS of the Host PC/Server must be configured to enable the hardware virtualization CPU setting.
  • Though not required, performance will be better with a solid state drive (SDD). In particular, it is recommended to store the VM images on SSD.
  • If cloned VMs are to be bound to an Active Directory domain:
    • The Master VM must not be bound to an Active Directory domain prior to cloning, and
    • "Writable" clones must be used.
  • Zero-client devices must be connected to the host PC, assigned, and configured.
  • All Master VM image(s) must be stored under the same user account, such as "administrator" (or any other user who will "own" the VM images).
  • If you access the internet through a proxy, it is important to configure your golden master image with the correct proxy settings.

Preparing for VM Installation

There are some simple steps required before installing VMs to use with Userful's station mapping solution; instructions are below.


Setting User Permissions for the "Owner" of the Virtual Machines

The user that will "own" the VM must have the proper access and permissions set in order to access and configure the VM.

In the case of the VirtualBox VM player, this means the user that is logged in when VirtualBox is used to install a VM will be the "owner" of the VM, and will be added automatically to the vboxusers group.

Install VirtualBox Extensions

Oracle VM VirtualBox provides some important extensions that extend the functionality of the VM Player, including improved USB device support.

Please Note: The VirtualBox Extension pack is distributed under the VirtualBox Personal Use and Evaluation License, which has some provisions for free academic use.

It is your responsibility to ensure that you comply with the license terms as set out by Oracle.


Userful provides a convenient one-step method to install VirtualBox Extension pack with Third-Party Add-Ons.

Go to UCC > System Operations > Third-party Add-ons; click "Install Third-party Add-ons" and select "VirtualBox Host Extension Pack Installer" and hit "OK" to download and install Extension Pack. Extension pack will install automatically; no reboot is required.

When the installation of extension pack is complete, you can verify that the extensions were properly installed. Open Oracle VirtualBox, go to Preferences, then click on "Extensions" from the category list on the left.


You are now ready to install a virtual machine, either from installation media or from a pre-existing VM file.

Creating a VM Master Image

A key advantage Userful's design is that cloning is automatic and quick; clones are copied from "known good" virtual machine master images known as golden masters.

Plan to build one or more master system images and have end-users only use clones of these. Once an optimized golden master image is created, it can be copied to several systems.

You can either use an existing Virtual Machine hard disk (which is like a VM template), or create a new one using install media. Instructions for both cases are below.

Creating a VM Master Image From Installation Media or Disk Image (.iso)

This process can be used to create a "golden master" VM image that can then be copied to other machines.

    VM-Name-Type-Version.png
  1. Login to the Userful Linux host operating system.
    • Userful recommends logging in with an administrator account, as this account will have access to create, configure and/or delete VMs.
  2. Launch VirtualBox by going to Applications > System Tools > Oracle VM VirtualBox
  3. Create a new VM by clicking the "New" button (at the top left hand side of the Oracle VirtualBox Manager). This opens the "Create Virtual Machine" window.
    • Note: At any point in the following instructions, press F1 to access VirtualBox help instantly.
  4. First, you are asked to select a name for the VM, and provide the type and version of the OS being installed. VirtualBox uses this information to properly configure and run the VM.
    • The Name can be whatever you like, but Userful recommends using a short but descriptive name. In the example to the right, Windows 7 is the Name.
    • Select a Type from the drop-down list. In the example to the right, the Type is Microsoft Windows.
    • Select a Version from the drop-down list. In the example to the right, the Version is "Windows 7".
      • Important: If your operating system is 64-bit, you must select the 64-bit Version of the OS.
  5. Click "Next" to proceed.

  6. VM-Memory-Allocation.png
  7. The next step is to select the amount of memory (RAM) that will be allocated to the virtual machine. In the example to the right, 1024MB (1GB) of RAM is allocated to the VM.
    • The more RAM is allocated to a VM, the better the performance will be.
    • Each VM (or VM clone) is restricted to use only the amount of RAM (plus a small overhead) allocated.
    • Ensure that your host server has enough RAM to handle the number of VMs you plan to run, at the memory allocation you select.
      • There is a wealth of information online regarding memory allocation for VMs. Userful recommends researching the memory requirements for the operating system you wish to install as a VM.
    Userful suggests the following minimum memory allocations for selected operating systems:
    • Android™ Platform: 512MB
    • Windows® XP: 512MB
    • Windows® 7: 1024MB
    • Windows® 8: 1024MB

    These are good starting points for demonstration purposes, but may not be sufficient for production use, depending on system hardware and/or intensity of usage.

  8. Click "Next" to proceed.

  9. VM-Storage-Allocation.png
  10. Create a virtual hard drive for your VM. Click to select "Create a virtual hard drive now" and click "Create".
  11. Choose the "VDI (VirtualBox Disk Image) type, and click "Next".
  12. Select either dynamically allocated or fixed storage size for the virtual hard drive.
    • Choosing "Fixed size" means that a portion of your hard disk storage will be reserved for the VM disk file.
    • Choosing "Dynamically allocated" means that the VM hard drive will only use space on the host's physical hard drive as it is needed (up to a maximum size that you will choose in the next step). Note that storage space is not "returned" to the host system even if the VM is no longer using it.
    • According to VirtualBox documentation, "While occupying much more space, a fixed-size file incurs less overhead and is therefore slightly faster than a dynamically allocated file."
  13. Next, you must name the virtual hard drive file and set a storage size. (See example, at right, where 25 GB of host (physical) hard disk storage is being allocated to the virtual machine.)
    • Ensure that your physical hard drive has enough capacity for the number of VMs you plan to run.
  14. Click "Create" to finish virtual hard drive creation. The "Create Virtual Hard Drive" window will close, leaving the "Oracle VM VirtualBox Manager" window; do not close this window.
    • Note: Your newly-created VM hard drive should appear in the VM list on the left side of the window.

    VM-Network-Settings.png
  15. Make sure that your new VM is selected; then, in the "VirtualBox Manager" window, click the "Settings" button in the upper left.
  16. Click on "Network" in the list on the left-hand side of the "[VM-Name] - Settings" window.
  17. Ensure that "Enable Network Adaptor" is checked, and select "Bridged Adapter" from the dropdown list.
  18. Click "OK".

  19. VM-Install-Disk.png
  20. You are now ready to install the operating system onto the virtual hard disk that you have just created.
    • If installing from media, insert the installation media (typically an optical disk) and wait several seconds for it to spin up or be mounted.
  21. In the "VirtualBox Manager" window, click "Start" to power up the VM.
  22. The VM player will typically give you one or two windows that contain tips and/or important information about working in your VM. Read these messages carefully before dismissing them.
  23. Next, the VM player will ask you to select a start-up disk; this is your installation CD/DVD or .iso file.
    • Click on the small "Folder" icon to browse to your host system's optical drive, or the location of the .iso file, then click "Start".

    VM-Window-Anatomy.png
  24. From this point, installation will proceed as if you were installing your chosen OS on a physical system.
    • Follow the instructions for installing your chosen operating system.
    • When installation is finished, you should have the VM running in VirtualBox.

    The image to the right is an example of what a VirtualBox VM looks like, when running in windowed mode.

    Note that at the top and bottom of the window are elements from the VirtualBox application.

    • The VirtualBox Menu Bar appears above the Guest OS window.
    • The Device Status Bar appears below the Guest OS.

    When a VM is run in fullscreen mode, no VirtualBox control elements will be visible. Stations mapped to VM stations will always run in fullscreen mode.


    VM-Guest-Additions.png
  25. The next important step is to install Guest Additions, if they are available for the Guest OS you have installed.
  26. To install Guest Additions, you must work within a running VM. Use the VirtualBox Menu Bar and go to Devices > Install Guest Additions; see the example on the right.
  27. Guest Additions will be loaded via a virtual CD/DVD drive.
    • Methods of accessing virtual optical drives will vary, depending on which Guest OS you are using. Make sure that the virtual CD/DVD drive is enabled in the VM player (refer to VirtualBox documentation for more information) and that the VM "owner" is in the cdrom user group.
    • To install, access the CD/DVD drive, find the appropriate .exe or .sh file (depending on the OS type), and follow the on-screen prompts to complete the installation. For detailed help installing Guest Additions, please see the VirtualBox documentation.


You are now ready to optimize your virtual machine, if desired.

Creating a VM Master Image with a Virtual Appliance

A virtual appliance is a virtual machine, complete with all customizations and settings (including memory allocation and network configuration).

The most common file format for virtual appliances is Open Virtualization Format, which is not specific to any VM player or system architecture.

An OVF package is a directory containing several files; for ease of copying and redistributing, OVF packages are often compressed with the tar utility into a single .ova file.

If you have an existing .ova file, it can be used to quickly install a Guest OS VM on host PC/server, complete with pre-configurated settings.

  • Copy the (.ova) file to the directory "/shared-files" on the target machine.
  • Open UCC, navigate to Virtual Machines and click “Refresh” button.
  • (.ova) file will show up in “VM Images in shared-files folder” section.
  • Click “Import VM Image” button next to (.ova) file to create the master image. This process takes some time.

Once finished, the VM Master Image is ready to use.

For instructions on importing (.ova) files, refer to the Oracle VirtualBox documentation.


VM Optimization

The instructions below are sufficient for demonstration and testing. For production environments, Userful strongly recommends either researching VM optimization for your Guest OS of choice, and/or following the recommendations in one of Userful's VM Optimization Guides.

Available VM Optimization Guides (guidelines prepared by Userful):

Before cloning from the Golden Master Image, make any desired changes to the guest OS (except binding to an Active Directory). This includes:

  • Applying OS updates, service packs and patches.
  • Installing any desired VirtualBox Tools, especially the Guest OS Tools.
  • Install and Configure management agents.
  • Install and run anti-virus software, if needed. (Note: "locked" clones are returned to a pristine state whenever they are restarted, and thus should not require anti-virus software.)
  • Backup software or files, if necessary.
  • Install and configure any desired end-user applications
  • Finally, de-fragment the guest hard disk.

Make sure that your cloning process does not result in virtual machines with duplicate system attributes.

Using a known-good ISO file to create your initial VM image can save time over using CD or DVD media and also avoids any risk of damage to physical install media.


Please Note: The performance of your Userful system is largely be determined by the care and steps taken with your Golden master image(s) prior to cloning. The impact of any mistakes or savings made in CPU usage or disk I/O when setting up your master image will be amplified 10-fold so it is really worth taking the time to prepare your master image correctly.

Saving and Exporting VM "Templates"

It can be very time-consuming to create Master Images on each system manually, by installing from media. Fortunately, VM players allow users to create VMs much more quickly by using an existing virtual machine as a template.


Exporting and Copying Virtual Appliance Files

The most common file format for virtual appliances is Open Virtualization Format, which is not specific to any VM player or system architecture. These files have a .ova format. When installing new Master VM Images from a .ova file, configuration data is also imported. Once a virtual machine is created and optimized, you may wish to create a virtual appliance (.ova to use as a Golden Master Image, to be deployed on several Userful systems.

VM-Appliance-Export-Filename.png

To do so:

  1. First, ensure you have a removable storage medium (such as a CD/DVD or USB flash drive) with enough capacity to save the .vdi file.
    • Alternatively, you can transfer files through ssh or another mechanism that you are familiar with.
  2. Next, launch VirtualBox by going to Applications > System Tools > Oracle VM VirtualBox
    • Note: At any point in the following instructions, press F1 to access VirtualBox help instantly.
  3. Export a .ova file by going to File > Export Appliance in the Oracle VirtualBox Manager. This opens the "Export Virtual Appliance" window.
  4. Choose a filename and location for the exported appliance by clicking on the "Choose" button.
    • Navigate to the folder where you wish to save the appliance file, and enter a filename with the .ova extension.
    • In the example to the right, the file path is /tmp/GuestOS.ova.
  5. Click "Next" to continue.

  6. VM-ova-File-Location.png
  7. A window will open showing the configuration options that are to be exported along with the virtual hard disk file.
    • To change any of the configuration settings, simply double-click on the description.
  8. Click "Export" to continue.
    • The export process will take several minutes.
  9. Once finished, navigate to the folder where the appliance file has been saved (see image to the right), and copy that file to your removable storage media (or transfer to another system by other means).


Troubleshooting

Changing the Memory Allocation for an Existing Virtual Machine

VM-Adjust-Memory-Alloc.png

If your VMs are sluggish and unresponsive, it may be that you have not allocated enough RAM to the VM. It is possible to change the memory allocation for a VM that has already been installed. Some things to remember:

  • Any changes to the configuration of the VM should be made to the golden master image. Then any clones will need to be resynchronized in order for the changes to be seen in the VM clones.
  • Be sure that increasing the RAM allocated to VMs does not exceed the capacity of your host system. See "Considerations When Using Virtual Machines", above.


Making Other Adjustments to Virtual Machines

Please refer to online Oracle VirtualBox documentation for information about troubleshooting virtual machines; if the official documentation does not help you find a solution, often a web search will turn up the answer.

Troubleshooting Userful's VDI solution

If anything bad or unexpected happens during the installation process, or with normal usage, you can reset either individual stations, or the entire Userful Control Center/Station Mapping interface with the following steps:

  1. Force a station to reload its Station Mapping configuration.
    • If a station is not being mapped correctly, press Ctrl+Alt+Backspace to force it to restart.
  2. Recreate the Station Mapping Clone.
    • If ctrl+alt+backspace does not work, you can try to recreate the clone itself.
    1. Power-off the faulty zero-client device.
    2. As the user who owns the VMs, Logon onto the host.
    3. Launch VirtualBox.
      1. Manually delete the faulty numbered VM clones named "<VM> Clone ##" (Hint: It probably has the VirtualBox Status "Aborted".)
    4. Power-on the faulty zero-client device.
    • When the station powers back on, the Cloned VM will be re-created from the master.
  3. Recreate the master VM.
    1. As the user who owns the VMs, Logon onto the host.
    2. Launch Userful Control Center.
      1. Navigate to Virtual Machines tab.
      2. Delete the master VM by clicking "Delete VM" button under Master Virtual Machines Summary.
      3. Recreate the master VM by clicking "Import VM image" button under VM Images in shared-files folder.
  4. Recreate entire VirtualBox environment.
    1. Power-off all zero-client devices assigned as a Virtual Machine
    2. As the user who owns the VMs, Logon onto the host.
    3. Delete the following paths.
      • /home/user/.VirtualBox/
      • /home/user/VirtualBox VMs/
    4. Launch VirtualBox.
      1. Recreate the master VM using the name as before..
      2. Boot the new master VM at least once, to validate if its ready to be cloned.
    5. Power-on the zero-client devices.
    • Once all the stations power back on, the system will begin recloning VMs from the re-created master.
  5. Reset the Station Mapping database.
    1. Launch the Userful Control Center.
      1. Go to System Operations.
      2. Reset Userful Multiseat Configuration.
      3. Click Apply.
    2. Reboot the Host PC/Server.
    3. Launch the Userful Control Center.
      1. Go to Station Mapping.
      2. Create a new Virtual Machine profile.
      3. Assign stations to the new Virtual Machine profile.
      4. Click Apply.