Contents

Installing a guest operating system onto a raw disk partition

From a virtual machine, you can access and use a completely unused disk on the host machine, and then install a guest operating system into it. However, you will most likely not be able to boot into this operating system outside of the virtual machine -- even though that data will be available to the host.

Caution: Raw disk support is an advanced feature of Workstation and should only be used by experienced users.

Note: You cannot use a raw disk partition where an operating system was previously installed. This is because Workstation has security controls that protect and control access to each raw IDE disk on the host system. These security controls prevent users from accidentally trying to run the host operating system as a guest, or another guest operating system for which the virtual machine was not configured. These controls also prevent other operating systems or applications from accidentally writing to raw disk partitions that are being used by virtual machines.

A better approach is to install the operating system in a dual-boot configuration on the host machine, and then set up virtual machines on the dual-boot system.

If you are using LILO as your boot manager (regardless of the host operating system) you will receive an error if you are trying to boot a virtual machine from an existing raw partition or disk. As part of booting a real PC or a virtual machine, the BIOS passes control to code located in the MBR of the boot device. LILO begins running from the MBR and in order to finish running correctly, it will need access to the native Linux partition (where the rest of LILO is located). If LILO can't access the rest of itself, an error will be displayed due to the native Linux boot partition most likely being configured with no access when the Wizard was run. To fix the problem re-run the Workstation Configuration Wizard, select Existing Partition and re-configure the virtual machine again, but this time make sure to mark the native Linux partition where the rest of LILO is located with read-only access. The next time the virtual machine tries to boot, the LILO code in MBR should be able to access the rest of LILO and display the normal "lilo: " prompt.

To prepare the virtual machine for the new operating system to be installed onto an unused raw disk:

  1. Identify the raw partition where the guest operating system will be installed.
  2. Check the guest operating system documentation regarding the type of partition to which the operating system can be installed. For example, operating systems like DOS, Windows 95, and Windows 98 must be installed to the first primary partition, while others like Linux can be installed to a primary or extended partition on any part of the drive.
  3. Depending on the guest operating system you will run, identify an appropriate raw partition or disk for it to use.

    Also, be sure the raw partition or disk does not have data you will need in the future; otherwise, back it up.

  4. Set the device group membership or device ownership.

    The master raw disk device(s) needs to be readable and writeable by the user who runs Workstation. On most distributions, the raw devices (such as /dev/hda, /dev/hdb) belong to the "group-id" disk. If this is the case, you can add Workstation users to the disk group. Another option is to change the owner of the device. Please think carefully of security in exploring different options here.

    It is typically a good idea to grant Workstation users access to all /dev/hd[abcd] raw devices that contain operating systems or boot managers and then rely on Workstation's raw disk configuration files to guard access. This helps provide boot managers access to configuration and other files they may need to boot the operating systems. For example, LILO needs to read /boot on a Linux partition to boot a non-Linux operating system that may be on another drive.

  5. Follow instructions to set up the virtual machine using the Configuration Wizard.
  6. When asked to choose a partition type, select Existing Partition from "Virtual Disk Type" and select the Enable disk partition hiding option.
  7. When asked to set access permissions on the partition, select the Read/Write option for the disk partition(s) that contain the guest operating system you will configure. The other partitions should be set to "Read Only".

    Caution: Corruption is possible if you allow the virtual machine to modify a partition that is simultaneously mapped under Windows NT, Windows 2000, or Windows XP. Since the virtual machine and guest operating system will be accessing a raw disk partition while the host continues to run Windows NT, Windows 2000, or Windows XP, it is critical that the virtual machine not be allowed to modify any partition mapped under the Windows NT, Windows 2000, or Windows XP host or in use by another virtual machine. To safeguard against this problem, be sure the raw disk partition you mark "Read Write" for the virtual machine is not in use.

  8. Start Workstation and manually change the controller/channel assignment selected by the Wizard:
    1. Type vmware config-file where config-file is the path of the configuration (.cfg) file created by the Wizard in the previous step.
    2. Open the Configuration Editor from the Settings menu and check that your IDE configuration specifies at least two raw disk description files; these files are named .hda, .hdb, etc.
    3. Identify the description file for the raw disk to which you will install the new guest operating system. For example, if your real machine has an unused disk on the secondary master IDE channel and you want to use this device for the virtual machine, you should see a file called .hdc next to the virtual machine's "IDE 1:0" configuration entry.
    4. Replace the description (.hda) file next to the virtual machine's "IDE 0:0" channel with the description file you identified in the previous step.
    5. Remove the other raw disk description file(s) from the virtual machine's IDE configuration dialog and click OK.
    6. Save the changes to the virtual machine's configuration file.

Related Topics:

Back to top

© 2001 VMware, Inc. All rights reserved.