Difference between revisions of "Transfer files from the host OS to the virtual drive"
DangerGround (talk | contribs) m (add category) |
|||
Line 106: | Line 106: | ||
When you are done using the image file, you can unmount it easily by using, | When you are done using the image file, you can unmount it easily by using, | ||
sudo umount /media/ReactOS | sudo umount /media/ReactOS | ||
+ | |||
+ | |||
+ | [[Category:Tutorial]] |
Revision as of 15:40, 17 November 2009
Many users prefer to test ReactOS under emulators and virtualization software like QEMU or VMware, but for testing their software they will need to copy their files into the .iso images and add them into proper directories which can become a difficult job. A way around this is to mount the virtual hard drives as disk drives attached to the system itself. Which can be easily done using VDK or VMware Mount
Contents
In Windows: VDK
- VDK (Virtual Disk Driver) can mount vmdk and raw format virtual drives which are supported by QEMU and VMware.
Getting the driver (VDK)
You can download VDK from here (x64 here). At the time of writing of this HOWTO the latest version is version 3.2. Download the .zip file and extract it to your desired folder using your favourite archiver.
Setup the driver
- Open the command prompt and move to the folder where you have extracted VDK using
cd
command (e.g. C:\VDK). - Issue the following command with the command prompt in the same directory,
vdk install /auto
/AUTO Configures the driver to start at the system startup (Note: this option does not start the driver after installation is completed). By default the driver has to be started manually.
The Virtual Disk kernel-mode Driver (vdk.sys) is copied to %SYSTEMROOT%\system32, you may need administrator privileges to install the driver.
Start the Driver
Even though the driver is installed, it may not be actually running. To start it issue the following command,
vdk start
If the driver is not already installed, this command attempts to install it with the default options. It is recommended that you use vdk install /auto
so that you do not have to manually start the driver every time.
Mounting the virtual drive
SYNTAX:
VDK.EXE OPEN disk# image [/RW | /WB | /UNDO] [/P:part#] [/L:drive]
OPTIONS:
disk# Specifies the virtual disk number. This must be the first parameter. '*' means the first available disk, and if all existing disk is busy a new virtual disk is created. image Specifies the path to the disk image file. This must be the second parameter. /RW Open the image in Read-Write mode. /WB Open the image in Write-Block mode. /UNDO Creates a REDO log for the image and open in Read-Write mode. /P:part# Specifies a partition number to set a drive letter. Drive letters can be set/removed later with LINK/ULINK commands. By default, drive letters are assigned to all mountable partitions. /L:drive Specifies drive letters to assign to partitions.By default, the first available drive letter is used.
Only one of /RW, /WB and /UNDO can be used at a time. When none of these is specified, the image is opened in Read-Only mode.
- Example of Vdk usage
In the vdk directory issue the following command,
vdk open * C:\ReactOS\ReactOS.vmdk /rw
Unmounting the virtual drive
Once you are done using the virtual drive it needs to be unmounted. This is done by issuing the following command,
vdk close *
Failure to do this will result in the drive being locked and usable to VMware or QEMU.
Stopping the driver
If you want you can stop the driver using,
vdk stop
More details and options are available in the Readme.txt in the previously downloaded .zip file.
VMware Disk Mount
- VMware Disk Mount Utility is easier to use but will work only with .vmdk files.(Official VMware virtual disk file format.)
- Download and install the tool which is available at the VMware website.
- Start Command Prompt.
- Move to the installation directory (e.g. C:\Program Files\VMware\VMware DiskMount Utility\)
- Mounting the virtual drive.
Issue the following command,
vmware-mount z: C:\ReactOS\ReactOS.vmdk
What it does,
vmware-mount - Starts the mount application. z: - Drive letter for the mounted drive. (You can use any free drive letter.) ...(Path) - Path to the virtual disk drive. NOTE: - The path above is an example. Use the path where you have saved your .vmdk file.
Unmounting the virtual drive
To unmount the virtual drive issue the following command,
vmware-mount z: /d
What it does,
vmware-mount - Starts the mount application. z: - Drive letter for the virtual drive to be unmounted. /d - Unmounts the drive.
- More information on other options can be found in the VMware mount documentation.
Mounting a QEMU image in Linux
Most Linux distributions allow you to mount virtual disk images using the mount
command. Ubuntu is used in this example, but it should work in most distributions.
For most of these actions you will need root access, so use the sudo
command. You will need to enter a password for this.
First you need to create a mounting directory,
sudo mkdir /media/ReactOS
Then, make sure your virtual image file is in RAW format. I created my image in QEMU Launcher, where you can select this format. If your image is in QCOW format, you can use the following command to convert to RAW,
qemu-img convert <image-file> -O raw <image-file.raw>
After this is done, you can mount the image,
sudo mount -o loop,offset=32256 <image-file> /media/ReactOS -t vfat
When you are done using the image file, you can unmount it easily by using,
sudo umount /media/ReactOS