当前位置:首页 > 虚拟机 > 正文

虚拟机怎么设置共享硬盘(虚拟机设置硬盘共享)

How does a Windows 7 virtual machine share the host's files?
Q: My computer is Windows 7 Ultimate and I use Microsoft Virtual PC, a virtual machine software. How do I let the virtual machine share the host's files?
Answer: After starting the virtual machine, click "Tools→InsertIntegrationDisk", then uninstall the old version of the Integration tool in the virtual machine, and install the new software in the virtual machine's CD-ROM drive.
Note: After enabling the integrated feature, a dialog box will pop up when the virtual machine starts, allowing you to enter the user name and password information used to log in to the virtual machine. Pay attention to fill in this step carefully. If you make an error, you will Enter the Windows login interface of the virtual machine and enter the user name and password here to enable the integrated features. In other words, if you click on the integration feature settings to let the virtual machine share one of your hard disk partitions, and you do not enter the user name and password when the virtual machine starts, you just enter the password on the Windows login interface of the virtual machine. The host's hard disk partition cannot be seen.

How to establish a shared disk between VMware virtual machines
How to set up disk sharing between VMware virtual machines and the host

1. Mapping the virtual machine to the host< /p>

With the virtual machine powered off, double-click the hard disk in the device column on the right, click "Utilities" in the pop-up window, and select "Mapping". Open the window for mapping virtual disks. The "volume" in it is which partition in the virtual machine you want to map to the host. If you need to change the content in the virtual machine, remove the check box below, otherwise it can only be read but not written. (If you do not select read-only mode, you will be asked whether this is risky and if you want to continue, select Yes).

Other content does not need to be changed. After "OK", you can access it directly in the host's My Computer.

If you want to start the virtual machine again at this time, remember to select "Disconnect Mapping" () in "Utilities" first, otherwise an error will pop up.


2. Mapping the host to the virtual machine

Mapping the disk in the virtual machine to the host can certainly achieve file access, But after the virtual machine is started, it can no longer be mapped to the host, and winxp does not support Linux file systems such as etc2/3 at all. It will prompt you that you need to format it, so you must not agree.

The best way at this time is to map the host's disk partition to the virtual machine.

" Settings", click "Add" in the pop-up hardware window, select "HardDisk" () in the hardware type of the pop-up window, and then select the third "Use physical disk" after next.

For the next two options, the device above refers to which hard disk the loaded disk or partition is on. If there is only one or it is on the first one, select physicalDrive0, which is on the second one. It is physicalDrive1. The following usage refers to mapping all partitions of the disk or a single partition. If it is a single partition, you will be asked which partition it is, but these are named after the physical name of the hard disk in the computer, and are generally distinguished by the capacity of the hard disk. For the rest, just go next.

After completion, an additional hard disk will appear in the device column on the right side of the main interface, so that the virtual machine will detect the "new" hard disk after it starts.

---------------------------------------------

Establishment of shared disks between VMware virtual machines


ESXserver3.5

1 .     Create a virtual disk

Telnet to ESXserverconsole and create a virtual disk through the following command

#The thick option here is required and specifies the pre-allocated space

2. Add a disk and share it

Log in to the ESXserver graphical console through VMware Infrastructure Client, add the newly created disk to the virtual machine, and then select a different scsi control from the disk that does not need to be shared when adding the disk. If scsi0:0 is the disk device for installing the operating system, scsi1:x should be selected for the newly added disk. In this way, a new scsi controller will be automatically created after the disk is added, as shown in the figure below. Set this scsi controller bus share as virtual.



3. Repeat steps 2 on other virtual machines and restart each virtual machine after completion.

VMwareworkstation/GSX

1. Create a virtual disk

#-t2 selection is the same ESXserver's option to create a virtual disk -dthick

2. Add a shared disk. The difference here from ESXserver is that the scsi controller bus sharing selection cannot be set in the graphical interface. You can modify the virtual machine's settings by adding the disk. config . Add

g="false" to the corresponding .vmx file and change Bus="none" to Bus="virtual"

3.             Repeat steps 2 on the virtual machine and restart each virtual machine after completion.

ESXi4

In ESXi4, the -d option of the vmkfstools tool does not have thick. At this time, select the eagerzeroedthick type. For details on how to use the console in ESXi4, please see: Turn on consoleSSH in ESXi4 Support

How to create a shared disk between VMware virtual machines
1. Create a shared disk cabinet
Real machine operation:
Create a folder: sharedisk
vmware installation folder List the files and create a new sharedisk directory:




Create a shared disk file:


4 files completed:

2. Configure the virtual machine
In the virtual machine interface, select EditvirtualmachinesettingsàAdd hard disk and select Useaexistingvirtualdisk. Do not add , sharedisk .vmdk Double-click the new disk and pop up the disk properties window and select advance Add the new hard disk and select the virtual device node: Select SCSI0:1 Select SCSI1:1
Don’t open the two virtual machine directories vmx file line to add :
g="FALSE"scsi0:Bus="Virtual"scsi1:Bus="Virtual"
vmware needs to meet two conditions to set up a shared disk: 1. The advanced properties of the hard disk must be set 1:0, add a second shared hard disk and set it to 1:0. The system error is reported as 1:1 (I have not tried the Oracle dual-machine article to see the setting)
2. A vmware configuration property file is required ( ) Add two attributes
scsi[n].sharedBus="virtual"
g="false" system startup lock disk enabled linux1 shared disk lock linux2 onwards, you need to add disk .locking="false"
Generally speaking, scsi1:0 means Bus="virtual" means that all buses are shared vmare recommended method
All buses are shared as described Bus= "virtual" changed to scsi1:="true"