Getting Started with Virtual Machines

From Userful Support
< Manuals/Station Mapping‎ | Virtual Machine
Revision as of 19:07, 20 February 2013 by Navdeep (talk | contribs) (Created page with "{{Public Support Wiki}} {{title| Getting Started with Virtual Machines }} {{CopyrightNotice|{{REVISIONYEAR}}}} {{translations|base}} ==Introduction == Userful's Virtual Desktop…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Copyright © 2013 Userful Corporation. All rights reserved.
(Updated 2013.02.20)


  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

VM-User-Permissions.png

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 must be in the vboxusers and cdrom group.

To add users to those groups:

  1. Go to System > Administration > Users and Groups to open the "User Manager" window.
  2. Select the appropriate user from the list and double-click to open the "User Properties". In the example to the right, the username is "userful".
  3. Click on the "Groups" tab to access the group list.
  4. Ensure that there is a checkmark in the box beside the groups cdrom and vboxusers.
  5. Click "OK" to close the "User Properties" window.
  6. Reboot the machine to reset user group membership values.


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.

VM-Save-Extensions.png

To download and install VirtualBox extensions:

  1. Using a web browser, go to the Oracle VirtualBox download page at https://www.virtualbox.org/wiki/Downloads
  2. On the download page, find "VirtualBox Extension Pack".
    • Several versions are available for download. It is very important that you download and install the extension pack with the same version as your installed version of VirtualBox.
      • To check what your installed version of VirtualBox is, open the application by going to Applications > System Tools > Oracle VM VirtualBox. From within VirtualBox, go to Help > About VirtualBox to show a dialogue with product information.
  3. Click on the appropriate link to and choose the "Save File" option to download and save the extension package, as shown on the right. Take note of the save location.

  4. VM-Install-Extensions.png
  5. Open the folder where the "Oracle_VM_VirtualBox_Extension_Pack" has been saved.
  6. Double-click on the package icon to start installation of the extension pack. The VirtualBox application will be opened as well.
    • Installation of the extension package is guided by an install wizard (see image on the right) and will require acceptance of the VirtualBox license agreement; the host system root password is also needed.
  7. When the installation of extensions is complete, you can verify that the extensions were properly installed. From within 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 From an Existing VM Hard Disk File

If you have an existing virtual hard disk file (with the VM player VirtualBox, the file will have a .vdi extension), this process can be used to quickly install a Guest OS VM on host/server Userful systems.

  • Copy the (.vdi) file to the directory /home/<username-of-VM-owner>/VirtualBox VMs/ on the target machine.
    • If necessary, create the directory.
  • For further instructions on saving/copying (.vdi) files, see below.

The (.vdi) file will retain any customization/optimization made to the Guest OS, including the installation of Guest Additions, but some manual configuration of the VM on the host/server system will be required.

To install a VM from a virtual hard drive file:

    VM-Name-From-vdi-File-Android.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, Android-GuestOS is the Name.
    • Select a Type from the drop-down list. In the example to the right, the Type is Linux.
    • Select a Version from the drop-down list. In the example to the right, the Version is "Other Linux".
      • 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-Android-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, 512MB 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-Use-Existing-Virtual-Hard-Drive.png
  10. Create a virtual hard drive for your VM. Click to select "Use an existing virtual hard drive file".
  11. Click on the "Folder" icon to navigate to and select your existing virtual hard drive file. In the example to the right, the file is "Android-GuestOS.vdi".
  12. Click "Create" to proceed.

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


Your VM Master Image is now ready for use.

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, it can be used to quickly install a Guest OS VM on host/server Userful systems, complete with pre-configurated settings.

  • Copy the (.ova) file to the directory /home/<username-of-VM-owner>/VirtualBox VMs/ on the target machine.
    • If necessary, create the directory.
  • For further instructions on exporting/copying (.ova) files, see below. You may also wish to refer to the Oracle VirtualBox documentation.


To install a VM from a virtual appliance:

    VM-Appliance-Import.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
    • Note: At any point in the following instructions, press F1 to access VirtualBox help instantly.
  3. Import a .ova file by going to File > Import Appliance in the Oracle VirtualBox Manager). This opens the "Appliance to import" window.

  4. VM-Appliance-Import-Choose.png
  5. Click on the "Open appliance" button to navigate to the saved .ova file.
  6. Click "Next" to proceed.

  7. VM-Appliance-Import.MAC.png
  8. A window will open showing the configuration options that are to be imported along with the virtual hard disk file.
    • To change any of the configuration settings, simply double-click on the description.
  9. If there is an option to reinitialize the MAC address of all virtual network cards, make sure to select that option.
    • In the example to the right, there is a checkbox that has been checked.
  10. Click on "Import" to continue.
    • The import process will take several minutes. Once finished, the VM Master Image is ready to use.


Using the Included Android OS Demo

Android.png

To make it easy for you to experience Userful's VDI functionality, Userful provides a pre-configured Android Platform virtual machine, which is created automatically during Userful Multiplatform installation.

This demo VM will appear automatically in the Oracle VirtualBox manager after import and in the Station Mapping section of the Userful Control Center;for instructions, see Creating a VM Master Image with a Virtual Appliance .

Should you ever need to re-install the demo Android VM, the virtual appliance file is located in the /media/content/sample-vdi/ folder; for instructions, see below.


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.

Virtual machine "templates" can be either:

  • VM player-specific; that is, a file type that is created by a specific VM player and is compatible only with that player.
    • If using Oracle VirtualBox, the "virtual hard drive" file has a .vdi extension.
    • When installing new Master VM Images from a .vdi file, some configuration will still need to be done on the target system.
  • VM-player neutral; that is, in a virtual appliance format that can be exported and/or imported from many VM players.
    • 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.

Saving and Copying Virtual Hard Disk Files to Use as Golden Master Images

Once a virtual machine is created and optimized, you may wish to use the VM's virtual hard disk file (.vdi as a Golden Master Image, to be deployed on several Userful systems.

VM-VDI-File-Location.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, find the .vdi file. Unless you have specified a different directory for VM storage, the virtual hard drive file will be in the directory that the VM player creates.
    • With Oracle VirtualBox, that directory is in the home directory of the user who "owns" the VMs. See the example, to the right.
    • Typically the file path is: /home/<VM-Owner>/VirtualBox VMs/<Guest-OS-Name>/
  3. Locate the file with the .vdi extension.
  4. Copy that file onto your removable storage media.


Exporting and Copying Virtual Appliance Files

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.


VM-ova-File-Location.png
  • 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.
  • Click "Export" to continue.
    • The export process will take several minutes.
  • 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. Power-off all zero-client devices assigned as a Virtual Machine.
      2. As the user who owns the VMs, Logon onto the host.
      3. Launch VirtualBox.
        1. Manually delete all numbered VM clones named "<VM> Clone ##".
        2. Manually delete the master VM.
        3. Recreate the master VM using the same name.
        4. Boot the new master VM at least once, to validate if its ready to be cloned.
      4. Power-on the zero-client devices.
      Once all the stations power back on, the system will begin recloning VMs from the re-created Master.
    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.