第一步:准备环境
VMware Workstation10在哪里下,我就不说了。下载以后大家建2个liunx系统啊。这个2个系统磁盘和分区尽量保持一致。
第二步:给主机A添加虚拟磁盘
这里不用瞎想,一定选择”独立“+”永久“
这个共享磁盘,最好存放在单独的目录下面,和2台虚拟机主机安装目录同级最好。
这里还有给新磁盘设置相应的属性
SCSI 先选择1:1
我这里要添加2块共享磁盘,我这里就截了添加第一块的,第二块步骤同上。
第三步:主机B引用刚才创建的磁盘
第四步:修改相关虚拟机文件
这一步2个主机的配置文件都要修改,我只给了其中一个的例子。2台主机修改方式一样。
先看原文件
[objc] view plain copy
-***********上面省去N行******************
usb:1.parent = "-1"
ide1:0.startConnected = "TRUE"
tools.syncTime = "FALSE"
tools.remindInstall = "FALSE"
toolsInstallManager.updateCounter = "1"
unity.wasCapable = "FALSE"
ethernet0.vnet = "VMnet1"
ethernet0.connectionType = "custom"
scsi0:1.present = "TRUE"
scsi0:1.fileName = "001-000001.vmdk"
scsi0:1.redo = ""
usb:0.present = "TRUE"
usb:0.deviceType = "hid"
usb:0.port = "0"
usb:0.parent = "-1"
scsi1.present = "TRUE" --从这行开始修改
scsi1.virtualDev = "lsilogic"
scsi1:1.present = "TRUE"
scsi1:1.fileName = "G:\shareDisk\001.vmdk"
scsi1:1.mode = "independent-persistent"
scsi1:2.present = "TRUE"
scsi1:2.fileName = "G:\shareDisk\002.vmdk"
scsi1:2.mode = "independent-persistent"
floppy0.present = "FALSE"
修改后:
[objc] view plain copy
scsi1.present = "TRUE"
scsi1.virtualDev = "lsilogic"
scsi1.sharedBus = "virtual" --新加的
scsi1:1.present = "TRUE"
scsi1:1.fileName = "G:\shareDisk\001.vmdk"
scsi1:1.mode = "independent-persistent"
scsi1:1.deviceType = "disk"--新加的
scsi1:2.present = "TRUE"
scsi1:2.fileName = "G:\shareDisk\002.vmdk"
scsi1:2.mode = "independent-persistent"
scsi1:2.deviceType = "disk"--新加的
floppy0.present = "FALSE"
disk.locking = "false" --新加的
diskLib.dataCacheMaxSize = "0" --新加的
diskLib.dataCacheMaxReadAheadSize = "0" --新加的
diskLib.DataCacheMinReadAheadSize = "0" --新加的
diskLib.dataCachePageSize = "4096" --新加的
diskLib.maxUnsyncedWrites = "0" --新加的
2台主机修改后,保存,启动系统
[objc] view plain copy
[root@shu2 ~]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 116065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 3916 31350847+ 8e Linux LVM
Disk /dev/sdb: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 22048 * 512 = 1048576 bytes
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 116065 * 512 = 8225280 bytes
Disk /dev/sdc doesn't contain a valid partition table
[root@shu2 ~]#
进去后,大家在2台主机输入fdisk -l就可以看到了。在其中一台主机上面 fdisk /dev/sd*后,
尽量重启后就可以使用了。