引入:
鉴于机房中学生操作的不确定性,客户系统的设计中满足教学需求是重要的,但确保客户系统的在日常使用中保持足够的强壮是很必要的。这也就是本篇中所要讨论的主题。
客户系统数据保护:
1、虚拟主机配置文件*.vmx的保护
修改后最终的配置文件“Windows XP Professional.vmx”的内容:
- #!/usr/bin/vmware
- .encoding = "UTF-8"
- config.version = "8"
- virtualHW.version = "7"
- scsi0.present = "TRUE"
- memsize = "1200"
- scsi0:0.present = "TRUE"
- scsi0:0.fileName = "Windows XP Professional.vmdk"
- ide1:0.present = "TRUE"
- ide1:0.deviceType = "cdrom-raw"
- ethernet0.present = "TRUE"
- ethernet0.connectionType = "nat"
- ethernet0.wakeOnPcktRcv = "FALSE"
- ethernet0.addressType = "generated"
- sound.present = "TRUE"
- sound.startConnected = "FALSE"
- sound.fileName = "-1"
- sound.autodetect = "TRUE"
- mks.enable3d = "FALSE"
- serial0.present = "TRUE"
- serial0.fileType = "thinprint"
- pciBridge0.present = "TRUE"
- pciBridge4.present = "TRUE"
- pciBridge4.virtualDev = "pcieRootPort"
- pciBridge4.functions = "8"
- pciBridge5.present = "TRUE"
- pciBridge5.virtualDev = "pcieRootPort"
- pciBridge5.functions = "8"
- pciBridge6.present = "TRUE"
- pciBridge6.virtualDev = "pcieRootPort"
- pciBridge6.functions = "8"
- pciBridge7.present = "TRUE"
- pciBridge7.virtualDev = "pcieRootPort"
- pciBridge7.functions = "8"
- vmci0.present = "TRUE"
- roamingVM.exitBehavior = "go"
- displayName = "Windows XP Professional"
- guestOS = "winxppro"
- nvram = "Windows XP Professional.nvram"
- virtualHW.productCompatibility = "hosted"
- printers.enabled = "TRUE"
- extendedConfigFile = "Windows XP Professional.vmxf"
- ide1:0.autodetect = "TRUE"
- ethernet0.generatedAddress = "00:0C:29:BF:4A:A2"
- tools.syncTime = "FALSE"
- uuid.location = "56 4d 42 01 62 45 91 a0-8f 1e 61 ed cf bf 4a a2"
- uuid.bios = "56 4d 42 01 62 45 91 a0-8f 1e 61 ed cf bf 4a a2"
- cleanShutdown = "FALSE"
- replay.supported = "FALSE"
- unity.wasCapable = "TRUE"
- replay.filename = ""
- scsi0:0.redo = ""
- pciBridge0.pciSlotNumber = "17"
- pciBridge4.pciSlotNumber = "21"
- pciBridge5.pciSlotNumber = "22"
- pciBridge6.pciSlotNumber = "23"
- pciBridge7.pciSlotNumber = "24"
- scsi0.pciSlotNumber = "16"
- ethernet0.pciSlotNumber = "33"
- sound.pciSlotNumber = "34"
- vmci0.pciSlotNumber = "36"
- vmotion.checkpointFBSize = "33554432"
- usb:1.present = "TRUE"
- ethernet0.generatedAddressOffset = "0"
- vmci0.id = "-809547102"
- usb:1.deviceType = "hub"
- scsi0:0.mode = "persistent"
- ide1:0.startConnected = "FALSE"
- gui.fullScreenAtPowerOn = "TRUE"
- usb.present = "FALSE"
- bios.forceSetupOnce = "FALSE"
- checkpoint.vmState = "Windows XP Professional-5b09eec1.vmss"
- ethernet0.startConnected = "TRUE"
- usb.pciSlotNumber = "-1"
- usb:1.speed = "2"
- usb:0.present = "TRUE"
- usb:0.deviceType = "mouse"
- usb:0.port = "0"
- usb:0.parent = "-1"
- ehci.present = "FALSE"
- floppy0.present = "FALSE"
- gui.lastPoweredViewMode = "fullscreen"
- gui.viewModeAtPowerOn = "fullscreen"
- tools.remindInstall = "FALSE"
删除磁盘后内容:
- #!/usr/bin/vmware
- .encoding = "UTF-8"
- config.version = "8"
- virtualHW.version = "7"
- scsi0.present = "TRUE"
- memsize = "1200"
- scsi0:0.present = "FALSE"
- scsi0:0.fileName = "Windows XP Professional.vmdk"
- 略……
比较磁盘被删除前后,文件内容的异同,便会轻易发现,仅仅是“scsi0:0.present"由原来的“TRUE”变为了“FALSE”而已。
删除网卡后的内容:
同上述操作,本人发现网卡删除会导致多行改动(配置文件会少几行内容),且ethernet0.present = "TRUE"行也会有所变化。读者可自行体会。
2.VMware软件属性设置
现在本人的做法是,先行在图形界面下设置,如果有有好的GUI界面的话,然后找到对应的配置文件,因在GUI界面的设置指向相关配置文件。故可以将修改后的配置文件做好备份,以期每次启动系统之时恢复之用。
VMware属性设置[见下图]:
通过上述设置可以在全屏状态下,当虚拟机获得焦点时,自动隐藏VM的控制菜单,且只有通过键盘才可再次将菜单激活,减少了学生对于VM的干扰。
与设置相对应的脚本文件:
- shenzhi@sz0850:~$ cat .vmware/preferences
- .encoding = "UTF-8"
- pref.eula.0.appName = "VMware Workstation"
- pref.eula.0.buildNumber = "591240"
- pref.trayicon.enabled = "true"
- pref.usbDev.maxDevs = "0"
- pref.keyboardAndMouse.maxProfiles = "0"
- hint.pciSound.alsaDLOpenFailed = "FALSE"
- hint.vmui.reset = "FALSE"
- pref.commandBar.toolbarEnabled = "FALSE"
- hint.vnet.promiscNotAllowed = "FALSE"
- pref.ws.session.window.count = "1"
- pref.ws.session.window0.tab.count = "0"
- pref.ws.session.window0.sidebar = "FALSE"
- pref.ws.session.window0.sidebar.width = "200"
- pref.ws.session.window0.statusBar = "FALSE"
- pref.ws.session.window0.tabs = "FALSE"
- pref.ws.session.window0.thumbnailBar = "FALSE"
- pref.ws.session.window0.thumbnailBar.size = "125"
- pref.ws.session.window0.thumbnailBar.view = "same-folder"
- pref.ws.session.window0.placement.left = "282"
- pref.ws.session.window0.placement.top = "22"
- pref.ws.session.window0.placement.right = "926"
- pref.ws.session.window0.placement.bottom = "531"
- pref.ws.session.window0.maximized = "FALSE"
- pref.autoFit = "TRUE"
- pref.autoFitFullScreen = "fitGuestToHost"
- prefvmx.defaultVMPath = "/home/shenzhi/vmware"
- pref.grabOnMouseClick = "TRUE"
- pref.grabOnKeyPress = "TRUE"
- pref.motionGrab = "TRUE"
- pref.motionUngrab = "TRUE"
- pref.fullscreen.autohide = "TRUE"
- pref.fullscreen.toolbarPixels = "0"
- pref.autoSoftwareUpdatePermission.epoch = ""
- pref.autoSoftwareUpdatePermission = "deny"
- pref.componentDownloadPermission.epoch = ""
- pref.componentDownloadPermission = "deny"
- pref.dataCollectionEnabled.epoch = ""
- pref.dataCollectionEnabled = "FALSE"
由此以来,关于VM客户机及VM软件的配置所指的文件,以及配置后对应文件内容的更改,在本文中浅浅提及,希望可以起到抛砖引玉的作用。
【完成于网络实训室, 16:25 2012/4/19 】
本文转自tiancong 51CTO博客,原文链接:http://blog.51cto.com/tiancong/837412