VMware, Inc. navigation bar


Support  







Products and Technology
News and Events
Support
VMware Store
Search VMware
Company
Download Software
Download the latest VMware Software
VMware For Linux
VMware for Windows NT and 2000
VMware Documentation
Quick Installation
Product Documentation
Technical Notes
Guest OS Installation Instructions
Product Frequently Asked Questions
Glossary
VMware Newsgroups
File an Incident
 

Using Raw Disks With VMware for Linux

 

This document explains issues involved in using raw disks with VMware for Linux.


Raw Disks
A Raw Disk disk is a physical IDE disk which your host operating system knows about. For example, with Linux as the host operating system, the Raw Disks are /dev/hda through /dev/hdl.


Safe Raw Disks
A Safe Raw Disk is a small file which describes how the different parts of a Raw Disk should be accessed by a Virtual Machine. For example:

Here is the content of "my_first_safe_raw_disk", a typical Safe Raw Disk for a Windows NT Virtual Machine running inside VMware for Linux:

===
DEVICE /dev/hda

# Partition type: MBR
RDONLY 0 62
# Partition type: HPFS/NTFS
ACCESS 63 8193149
# Partition type: Linux swap
NO_ACCESS 8193150 8466254
===

The Virtual Machine will be able to access the /dev/hda Raw Disk. The access information for sectors on the Raw Disk is as follows

Partition Type

Sectors Access Rights
Linux boot information 0 through 62 inclusive Read-Only
NTFS or FAT 63 through 8193149 inclusive Read-Write
Linux swap 8193150 through 8466254 inclusive Forbidden

If the guest operating system inside the Virtual Machine attempts a forbidden read or write operation to the Safe Raw Disk, vmware will display a pop-up window asking the user to authorize or deny the access.


Installing a Safe Raw Disk in a Virtual Machine
To install a Safe Raw Disk in your Virtual Machine,

  • Determine which Raw Disk you would like to access from a Virtual Machine.
  • Open the Configuration Editor in the Virtual Machine for which you want to create a Safe Raw Disk.
  • Expand the "IDE Drives" node.
  • Look for "Not installed" drives. If there are none, your Virtual Machine is already configured with four IDE drives, and will not be able to configure another one.  You must remove one of the configured IDE Drives.  To do this, click on the one you want to remove, and click on the "Remove" button.
  • Click on a "Not installed" drive. For example, if you choose "P-S Not Installed", it means that your Raw Disk will be seen by the Virtual Machine as the slave IDE device of the primary IDE controller.
  • Set the Device Type field to "Raw Disk"
  • Set the Name field to the name of your Safe Raw Disk (e.g. "my_first_safe_raw_disk")
  • Set the Device to your Raw Disk device (e.g. "/dev/hda")
  • Click on the "Edit Raw Disk..." button. A new window appears, that displays a list of partitions present on your Raw Disk.
  • For each partition, select the access rights the Virtual Machine will have. At this point, you need to know what access rights your guest operating system will need. Here are a few tips to help you with this step:

    The following options are possible:

    • No Access - The Virtual Machine will not be able to read or write on the partition at all. Use it only if you suspect that your guest operating system is buggy, and if you want to track random off-range read accesses.
    • Read/Write - The Virtual Machine will be able to read from and write to the partition. Use it for partitions that your guest operating system knows about natively.
    • Read-Only - The Virtual Machine will only be able to read data from the partition. Use it everywhere else.

  • Click on the "Save" button. Sometimes, a pop-up window will warn you that two partitions overlap (they have a range of sectors in common), and that consequently they should have the same access rights. If this is the case, change the access right of one of these two partitions, and retry clicking on the "Save" button.
  • The Safe Raw Disk is now written in your Virtual Machine directory. Click on the "Install" button to actually connect the Raw Disk to your Virtual Machine.
  • You are now ready to have your Raw Disk used by your Virtual Machine.

As with a Virtual Disk, you should decide in which mode (persistent, non-persistent, or undoable) the Raw Disk will be used. Before booting your Virtual Machine, please read carefully this section.

If you need to install an operating system on the Raw Disk, you may want to look at the technote whose title is "Installing an operating system onto a Raw Partition from a Virtual Machine Using VMware for Linux". If there is already an operating system on the Raw Disk, and you want to use it sometimes as a host operating system and sometimes as a guest operating system, you may want to have a look at the technote whose title is "Configuring Dual/Multi-Boot Systems to Run With VMware for Linux"


Removing a Safe Raw Disk from a Virtual Machine

  • Open the Configuration Editor in the Virtual Machine from which you want to remove the Safe Raw Disk.
  • Expand the "IDE Drives" node.
  • Look for "Raw Disk" drives. Click on the one you want to remove.
  • Click on the "Remove" button.


Modifying a Safe Raw Disk
A Safe Raw Disk has been generated previously (either because you used the Configuration Wizard or because you used the Configuration Editor as described above in this document) and you would like to modify it.

If you want to use another Raw Disk or if you have modified the layout of the partitions on the Raw Disk, then first see above to remove (or rename) the Safe Raw Disk, then go to the installation section of this document to create a new Safe Raw Disk corresponding to the new Raw Disk.

If, on the contrary, the Raw Disk hasn't changed, but you want to change the access rights of the Virtual Machine to the Raw Disk (which means that you want to modify the Safe Raw Disk), just click on the "Edit Raw Disk..." button, then do as in the "Edit Raw Disk..." paragraph of the installation section of this document, then click on the "Save" button.


Risks in Using Raw Disks
It is perfectly safe if it is done right. The only danger is to have Raw Disk accessed simultaneously from the host and the guest operating system. Because each operating system is unaware of the other, data corruption can occur if  both operating systems read or write to the same sectors at the same time. The whole point about Safe Raw Disk is to regulate disk operations of the guest operating system. Currently, VMware does nothing to regulate disk operations of the host operating system.

Consequently, you should ensure that your host operating system doesn't "see" the partitions with which your guest operating system works. The safety of Raw Disks depends only on this requirement.

If you need to exchange data between a host and a guest operating system, either serialize disk accesses (for example on Linux, mount the Raw Disk, put the data on it, unmount the disk, start vmware, read the data, stop vmware), or use network protocols such as SMB (Windows Networking, implemented by Samba under Linux) or NFS.


Frequently Asked Questions

  1. What does this message "The partition information in file doesn't match that of device ." mean?
    It means the configuration editor has detected that the access rights in your Safe Raw Disk can not be applied to the list of partitions present on the device you specified in the "Device" field.

    It typically happens in these cases:

    • The Raw Disk used to create the Safe Raw Disk is different from the one you typed in the "Device" field.
    • You have modified the layout of the partitions on the Raw Disk. This can happen when:
      • You have replaced a drive in the physical machine.
      • You have moved the Safe Raw Disk to another physical machine.
      To get rid of this message, the safest thing to do is to remove the Safe Raw Disk (see above).

  2. Can I move a Safe Raw Disk from one physical machine to another?
    No unless both machines have disks with an identical content. Otherwise, vmware will detect the situation and issue a warning message described above in question 1.
  3. Can I mix Raw Disks and Virtual Disks in the same Virtual Machine?
    Yes. This feature is particularly useful when you want to transfer a lot of data to a Virtual Disk.

  line
  Navigational Banner © 1999 VMware, Inc. All Rights Reserved