Professional Documents
Culture Documents
Vmware Disk Mount User'S Guide: Virtual Disk Development Kit
Vmware Disk Mount User'S Guide: Virtual Disk Development Kit
You can find the most up-to-date technical documentation on the VMware Web site at:
http://www.vmware.com/support/
The VMware Web site also provides the latest product updates.
If you have comments about this documentation, submit your feedback to:
docfeedback@vmware.com
2008 VMware, Inc. All rights reserved. Protected by one or more U.S. Patent Nos. 6,397,242, 6,496,847, 6,704,925, 6,711,672,
6,725,289, 6,735,601, 6,785,886, 6,789,156, 6,795,966, 6,880,022, 6,944,699, 6,961,806, 6,961,941, 7,069,413, 7,082,598,
7,089,377, 7,111,086, 7,111,145, 7,117,481, 7,149,843, 7,155,558, 7,222,221, 7,260,815, 7,260,820, 7,269,683, 7,275,136,
7,277,998, 7,277,999, 7,278,030, 7,281,102, 7,290,253, 7,356,679, 7,409,487, 7,412,492, 7,412,702, 7,424,710, and 7,428,636;
patents pending.
VMware, the VMware boxes logo and design, Virtual SMP, and VMotion are registered trademarks or trademarks of
VMware, Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks
of their respective companies.
VMware, Inc.
3401 Hillview Ave.
Palo Alto, CA 94304
www.vmware.com
VMware, Inc.
Contents
AboutThisBook
UsingVMwareDiskMount
LimitationsonMountingVirtualDisks 7
RunningVMwareDiskMountonaWindowsHost 8
LogFiles 8
ExamplesUsingVMwareDiskMountonaWindowsHost 9
RunningVMwareDiskMountonaLinuxHost 10
LogFile 10
ExamplesUsingVMwareDiskMountonaLinuxHost 11
InstallingtheFusePackage 12
VMware, Inc.
VMware, Inc.
ThisVMwaremanual,theVMwareDiskMountUsersGuide,providesanintroductiontousingthe
vmware-mountcommandlineutility.
Revision History
Thisbookisrevisedwitheachreleaseoftheproductorwhennecessary.Arevisedversioncancontainminor
ormajorchanges.Table P1summarizesthesignificantchangesineachversionofthisguide.
Table P-1. Revision History
Revision
Description
20050408
FirstversionoftheVMwareDiskMountUsersGuide.
20070607
UpdatewithsupportforLinuxhostsandremotevirtualdisks.
20080122
Newoptionforinventorypathofthevirtualmachine.
20080625
UpdatedsupportinformationandFusemount.
20080717
Correctedinformationaboutsnapshotsand/poption.
20080915
AddedinformationaboutWindowsandLinuxlogfiles.
Intended Audience
ThisbookisintendedforanyonewhousesVMwareDiskMount.Userstypicallyincludepeoplewhodo
softwaredevelopmentandtestingorworkwithmultipleoperatingsystemsorcomputingenvironments:
systemadministrators,applicationdevelopers,QAengineers,andanyonewhowantstocreate,manage,and
modifyvirtualdiskfilesfromscriptsoratthecommandline.
Documentation Resources
ToaccessthecurrentversionsofVMwareAPIandSDKdocumentation,goto:
http://www.vmware.com/support/pubs/sdk_pubs.html
ToaccessthecurrentversionsofotherVMwaremanuals,goto:
http://www.vmware.com/support/pubs
Documentation Feedback
VMwarewelcomesyoursuggestionsforimprovingourdocumentation.Sendyourfeedbackto:
docfeedback@vmware.com
VMware, Inc.
Online Support
YoucansubmitquestionsorpostcommentstotheDeveloperCommunitySDKsandAPIsforum,whichis
monitoredbyVMwaretechnicalsupportandproductteams.Toaccesstheforum,goto:
http://communities.vmware.com/community/developer
Support Offerings
TofindouthowVMwaresupportofferingscanhelpmeetyourbusinessneeds,goto:
http://www.vmware.com/support/services
VMware, Inc.
VMwareDiskMountisautilityforWindowsandLinuxhoststhatallowsyoutomountanunusedvirtualdisk
asaseparatedriveorpartitionwithoutneedingtoconnecttothevirtualdiskfromwithinavirtualmachine.
Youcanmountspecificvolumesofavirtualdiskifthevirtualdiskispartitioned.
Afteryoumountavirtualdisk,youcanreadfromandwritetothemountedvirtualdiskasifitwereaseparate
filesystemwithitsowndriveletterormountpointonyourcomputer.Forexample,youcouldscanthedisk
forvirusesortransferfilesbetweenthehostsystemandapoweredoffvirtualmachine.Whenyouarefinished
usingamountedvirtualdisk,youshouldunmountitsothevirtualmachinecanuseitsvirtualdiskagain.
Thischaptercontainsthefollowingsections:
LimitationsonMountingVirtualDisksonpage 7.
RunningVMwareDiskMountonaWindowsHostonpage 8.
RunningVMwareDiskMountonaLinuxHostonpage 10.
Youcannotmountavirtualdiskthatiscurrentlybeingusedbyarunningorsuspendedvirtualmachine.
Youcanonlymountdisksthatareinapoweredoffvirtualmachine,ordisksthatarenotarenotassociated
withavirtualmachine.
YoucanmountandreadWindowsvirtualdisksonWindowshosts(withatleastoneNTFSvolume)or
LinuxvirtualdisksonLinuxhosts.Crossmountingisrestrictedasdescribedbelow.
YoucanuseDiskMountwithvirtualdiskscreatedbyVMwareESXServer3.xand2.x(preallocateddisks
only),VMwareWorkstation6,5,or4,VMwarePlayer,VMwareACE,VMwareFusion,VMwareServer2
or1,andVMwareGSXServer3.xand2.5.Howeveryoucannotmountencryptedvirtualdisks.
Youcannotmountavirtualdiskifanyofits.vmdkfilesarecompressedorhavereadonlypermissions.
Changetheseattributesbeforemountingthevirtualdisk.
OnWindowshosts,youmustmountvirtualdisksasdriveD:orgreater.Youcannotspecifyadriveletter
alreadyinuseonthehost.
OnWindowshosts,youcanmountvolumesformattedwithFAT(12/16/32)orNTFSonly.Ifthevirtual
diskhasamixofpartitionsorvolumeswhere,forexample,apartitionisunformattedorisformattedwith
aLinuxoperatingsystemandanotherpartitionisformattedwithaWindowsoperatingsystem,youcan
mounttheWindowspartitionwithDiskMount.
Ifyouspecifyavirtualdiskwithsnapshots,thiscommandlocatesandmountsthelastsnapshot.On
Windowsyoucanmountprevioussnapshotsreadonly.OnLinuxyoucannotmountprevioussnapshots.
CAUTIONWhenyouhaveasnapshotmountedwithvmware-mount,donotreverttoaprevioussnapshot
usinganyotherVMwareinterface.Doingsomakesitimpossibletounmountthepartition.
VMware, Inc.
DiskMountrunsfromthecommandlineonanyversionofWindows2000,WindowsXP,WindowsServer
2003,orWindowsVista,aswellasanyversionofLinuxthatissupportedasahostforVMwareWorkstation.
DiskMountonLinuxrequirestheFusepackage.SeeInstallingtheFusePackageonpage 12.
Usedriveletter:tospecifythedriveletterwhereyouwanttomountorunmountavirtualdisk.Examples
inthissectionusetheJ:driveandnearbyletters.
Thepath-to-vmdkspecifiesthelocationofavirtualdiskthatyouwanttomountorqueryforinformation,
C:\DocumentsandSettings\<user>\MyDocuments\MyVirtualMachines\<VMname>\<VMname>.vmdk
forexample,where<VMname>isthenameofavirtualmachine.
Withnoarguments,vmware-mountdisplaysmounteddrivemappings,ifany.Thisissimilartothe/Loption.
Possibleoptionsare:
Option
Definition
/v:N
MountsvolumeNofavirtualdisk.Ndefaultsto1.
/d
Givenadriveletter,deletesthemappingtothevirtualdiskdrivevolume.
/f
Forciblydeletesthemappingtoavirtualdiskdrivevolume.Usethisoptionwhena
technicalerrororacorrectableconditionsuchasopenfilehandlespreventsDiskMount
fromunmountingthedrive.Otherwisestopaccessingthevolumeanduse/d.
/p
Givenpath-to-vmdk,displaysthepartitions(volumes)onthevirtualdisk.Localonly.
/L
Displaysallvirtualdisksmountedonthehostcomputer.Usewithoutotheroptions.
/m:w
Mountsdiskinreadandwritemode,thedefault.
/m:n
Mountsdiskinnonpersistentreadonlymode.Allowsmountingofsnapshotdisk.
/?
Displaysvmware-mountusageinformation.
Theoptionsforremotevirtualdisksare:
Option
Definition
/i:InventoryPath
SpecifiesinventorypathontheVirtualCenterthatmanagesthisvirtualdisk.
/h:HostName
SpecifiesthenameorIPaddressoftheESXServertoaccessthemanagedvirtualdisk.
/u:UserName
SpecifiesusernamefortheESXServer.
/s:Password
SpecifiesthepasswordfortheESXServer.
/P:Port
SpecifiesthePortnumberusedtocommunicatewiththeserver.Thisisoptionaland
defaultsto902.
Log Files
OnWindowsthediagnosticlogfilesforeach<user>whoranvmware-mountarelocatedhere:
C:\Documents and Settings\<user>\Local Settings\Temp\vmware-<user>-<nnnn>/vmount.log
C:\Documents and Settings\<user>\Local Settings\Temp\vmware-<user>-<nnnn>/vmount-client.log
VMware, Inc.
Herearetwoexamples,connectingthroughESXServerandVirtualCenter:
vmware-mount K: [storage1] WinXP/WinXP.vmdk /i:ha-datacenter/vm/WinXP /h:esx3 /u:root /s:secret
vmware-mount K: [storage1] WinXP/WinXP.vmdk /i:Datacenter/vm/WinXP /h:vc2 /u:admin /s:secretv
NOTEESXpathnamesarecasesensitive.
To unmount the J: drive, if not in use
Usethe/doption:
vmware-mount J: /d
Inventory Path
OnanESXserverwiththe/ioption,specifyInventoryPathas:
/i:ha-datacenter/vm/<VMpathname as read from inventory tree in VC client UI>
OnVirtualCenterwiththe/ioption,specifyInventoryPathas:
/i:<Path to your datacenter>/vm/<VMpathname as read from inventory tree in VC client UI>
ThepathtoyourdatacenterisasreadfromthetreedisplayintheVirtualCenterUI.
VMware, Inc.
Youcanmountaspecificpartitionofavirtualdisk,eitherlocalorremote.
Thecommandsyntaxformountingaspecificpartitionisasfollows(defaultpartitionNumberis1):
vmware-mount /path/to/disk [partitionNumber] /mount/point
Youcanmountaflatfilerepresentationofanentirevirtualdisk.
Thecommandsyntaxformountingaflatfilerepresentationis:
vmware-mount -f /path/to/disk /mount/point
DiskMountincludesanumberofotheroptionstousewithvirtualdisksandmountpoints.Thecommand
syntaxformostoptionsiseitherofthefollowing:
vmware-mount [option] [/path/to/disk]
vmware-mount [option] [/mount/point]
Inthefollowinglistofoptions,<diskID>isanidentifieroftheformusername@hostname:/path/to/disk
forremotedisks,orjustthe/path/to/diskforlocaldisks.Optionsthatmountaremotediskalsorequirethe
-h,-u,-F,andpossibly-voptions.The-voptionisrequiredwhenconnectingtoaVirtualCenter.
Option
Definition
<diskID> <mountPoint>
Mounts
-p <diskID>
Displaysthepartitionsonavirtualdisk.
-l <diskID>
Displaysallmountedpartitionsavirtualdisk.
-L
Displaysallvirtualdisksmountedonthehostcomputer.
-d <mountPoint>
Cleanlyunmountsthispartition,closingdiskifitisthelastpartition.
-f <diskID> <mountPoint>
Mountsaflatfilerepresentationofanentirevirtualdiskatthespecifiedmountpoint.
-k <diskID>
Unmountsallpartitionsonavirtualdiskandclosesthevirtualdisk.
-K <diskID>
Forciblyunmountsallpartitionsonavirtualdiskandclosesallvirtualdisks.
-x
Unmountsallpartitionsandclosesallvirtualdisks.
-X
Forciblyunmountsallpartitionsandclosesallvirtualdisks.
Theoptionsforremotevirtualdisksare:
Option
Definition
-v InventoryPath
SpecifiesinventorypathontheVirtualCenterthatmanagesthisvirtualdisk
-h HostName
SpecifiesthenameorIPaddressoftheESXServertoaccessthemanagedvirtualdisk.
-u UserName
SpecifiesusernamefortheESXServer.
-F PasswordFile
SpecifiesthepathnametoaplaintextfilecontainingthepasswordfortheESXServer.
-P Port
SpecifiesthePortnumberusedtocommunicatewiththeserver.Thisisoptionaland
defaultsto902.
Log File
OnLinuxthediagnosticlogfilesforeach<user>whoranvmware-mountarelocatedhere:
/tmp/vmware-<user>/fuseMount.log
10
VMware, Inc.
Herearetwoexamples,connectingthroughESXServerandVirtualCenter:
vmware-mount -i ha-datacenter/vm/RH5 -h esx3 -u root -F pwf "[storage1] RH5/RH5.vmdk" /mnt/rh5
vmware-mount -i Datacenter/vm/RH5 -h vc2 -u admin -F pwf "[storage1] RH5/RH5.vmdk" /mnt/rh5
NOTEESXpathnamesarecasesensitive.
To mount a flat representation of a virtual disk
Usethe-foption:
vmware-mount -f /vmware/guest/SUSE10/SUSE10.vmdk /mnt/suse10
Youcanalsousethe-koptionandsupplyadiskID:
vmware-mount -k root@esx3.example.com:[storage1]RHEL5/RHEL5.vmdk
Youmayalsousethe-xor -Xoptiontounmount,orforceunmount,allpartitions.
Inventory Path
OnanESXserverwiththe/ioption,specifyInventoryPathas:
/i:ha-datacenter/vm/<VMpathname as read from inventory tree in VC client UI>
OnVirtualCenterwiththe/ioption,specifyInventoryPathas:
/i:<Path to your datacenter>/vm/<VMpathname as read from inventory tree in VC client UI>
ThepathtoyourdatacenterisasreadfromthetreedisplayintheVirtualCenterUI.
VMware, Inc.
11
Ifthesecondlineshowingfuse.koappears,stop.
Ifnooutputappears,proceedtooneofthesectionsbelow.
To install Fuse with APT
ObtaintheFusepackageonLinuxsystemsthatuseAPTinstallerasfollows:
sudo apt-get install fuse-utils
Nowyoucanrunthevmware-mountcommandasdescribedinthismanual.
To install Fuse from the Web
1
DownloadFusesoftwarefromthehttp://fuse.sourceforge.netWebsite.
Unpackthesoftwareandchangetotheunpackeddirectory:
tar -zxf <FusePackage>.tar.gz
cd <FusePackage>
Configurethemakefileforyoursystemandrunmaketocompileit:
./configure
make
Assuperuser,installthepackage(thisputsitin/usr/local/lib):
sudo make install
If/usr/local/libisnotlistedin/etc/ld.so.conforanincludedfile,insertalineforitandrunthe
ldconfigcommand.Alternatively,modifyyourLD_LIBRARY_PATHenvironment.
sudo edit /etc/ld.so.conf
sudo ldconfig
RunthemodprobecommandtoinsertFusemoduleintothekernel:
sudo modprobe fuse
Nowyoucanrunthevmware-mountcommandasdescribedinthismanual.
12
VMware, Inc.