vmware-mount Using VMware Disk Mount


Limitations on Mounting Virtual Disks

https://pubs.vmware.com/vsphere-50/index.jsp#com.vmware.vddk.utils.doc_50/diskutils_mount.4.2.html

Limitations on Mounting Virtual Disks
Consider the following when you mount virtual disks:
You cannot mount virtual disks that are in use by a running or suspended virtual machine. You can mount disks from a powered off virtual machine, or disks that are not associated with a virtual machine.
You cannot mount a virtual disk if any of its .vmdk files are encrypted, compressed, or have read-only permissions. Change these attributes before mounting the virtual disk.
You can use Disk Mount with virtual disks created by ESX/ESXi 3.x or higher, Workstation 4 or higher, VMware Fusion, VMware Player, and VMware Server.
With Windows, you must mount virtual disks on drive D: or greater. You cannot specify a drive letter already in use.
You can mount large > 2GB disks on Windows NTFS only, specifying a drive letter. For other file systems, there is no reliable way to tell if large files are supported, so disk files should be split into 2GB segments (split sparse or split flat). NFS v2 had a 2GB file size limit, as did the Linux 2.4 kernel.
You can mount and read Windows virtual disks on Windows hosts (with at least one NTFS volume) or Linux virtual disks on Linux hosts. Cross-mounting is restricted. With Windows, you can mount volumes formatted with FAT (12/16/32) or NTFS. If the virtual disk has a mix of partitions or volumes where, for example, a partition is unformatted or is formatted by a Linux operating system and another partition is formatted by a Windows operating system, you can mount the Windows partition with Disk Mount.
If you specify virtual disk with snapshots, Disk Mount locates and mounts the last snapshot. On Windows you can mount previous snapshots read-only. On Linux you cannot mount previous snapshots.
 
*  
Caution When you have a snapshot mounted with vmware-mount, do not revert to a previous snapshot using any other VMware interface. Doing so makes it impossible to unmount the partition.
Disk Mount runs from the command line on any version of Windows XP, Windows Server 2003, Windows Server 2008, or Windows 7, as well as any version of Linux that is supported as a host for VDDK or in some cases additional ones for VMware Workstation.
Disk Mount on Linux requires the Fuse package. See Installing the Fuse Package.
When you are finished using a mounted virtual disk, you should unmount it so the virtual machine can use its virtual disk again.

 

Running VMware Disk Mount on a Windows Host

Log Files
On Windows the diagnostic log files for each <user> who ran vmware-mount are located here:
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
Examples Using VMware Disk Mount on a Windows Host
Following are some examples that illustrate how to use Disk Mount on a Windows host.
To mount a local virtual disk
Assuming shortcut C:\My Virtual Machines and virtual machine WindowsXP, type this command:
vmware-mount J: "C:\My Virtual Machines\WindowsXP\WindowsXP.vmdk"
To mount a remote virtual disk
Type a command in this form, where <VMname> is the guest OS name, <inv> is the inventory path, <server> is an ESX/ESXi host or VMware vCenter, <user> is a privileged user, and <password> is the user’s password:
vmware-mount K: "[storage1] <VMname>/<VMname>.vmdk" /i:<inv> /h:<server> /u:<user> /s:<password>
Here are two examples, connecting to an ESX/ESXi host and through VMware vCenter:
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
 
Note ESX/ESXi path names are case-sensitive.
To unmount the J: drive, if not in use
Use the /d option:
vmware-mount J: /d
To mount a specific volume from a virtual disk
List the volume partitions, then decide which to mount:
vmware-mount "C:\My Virtual Machines\WindowsXP\WindowsXP.vmdk" /p
vmware-mount J: "C:\My Virtual Machines\WindowsXP\WindowsXP.vmdk" /v:2
To list the currently mounted virtual disks
Use the /L option, with sample output shown below:
vmware-mount /L
Currently mounted volumes:
J:\ => C:\My Virtual Machines\WindowsXP\WindowsXP.vmdk
K:\ => [storage1]WindowsXP2/WindowsXP2.vmdk
To unmount a virtual disk so virtual machines can access it again
Using drive letters from the examples above, type:
vmware-mount J: /d
vmware-mount K: /d
About the Inventory Path
On an ESX/ESXi host with the /i option, specify InventoryPath as:
/i:ha-datacenter/vm/<VMpathname-as-read from-inventory-tree-in-VC-client-UI>
On VMware vCenter with the /i option, specify InventoryPath as:
/i:<Path-to-datacenter>/vm/<VMpathname-as-read from-inventory-tree-in-VC-client-UI>
The path to your datacenter is as read from the tree display in the VMware vCenter UI.
Formulating the ESX Inventory Path
Connect to an ESX/ESXi host, select a virtual machine, in this case covTest, and right-click Edit Settings or click Summary > Edit Settings. A properties dialog box appears for the virtual machine, as shown in VMware vSphere Client on an ESX/ESXi host.
VMware vSphere Client on an ESX/ESXi host
On any ESX/ESXi host, ha-datacenter is the datacenter name. You see this in the Managed Object Browser at https://<esx-hostname>/mob/?moid=ha-datacenter. To formulate the inventory path, append /vm followed by the virtual machine name as it appears where you selected it in the VMware vSphere Client. To obtain the path to virtual disk, select disk in the hardware summary, and read the Disk File text box.
This command mounts the virtual disk file covTest.vmdk on Windows drive letter Q:
vmware-mount Q: /v:1 /i:"ha-datacenter/vm/covTest" "[storage1] covTest/covTest.vmdk" /h:esx35.example.com /u:root /s:secretpw
Formulating the VMware vCenter Inventory Path
Connect to a VMware vCenter server, set display mode to Virtual Machines & Templates, select a virtual machine, in this case covTest, and right-click Edit Settings or click Summary > Edit Settings. A properties dialog box appears for the virtual machine, as shown in VMware vSphere Client on a VMware vCenter Server.
VMware vSphere Client on a VMware vCenter Server
On VMware vCenter, the datacenter name starts under Virtual Machines & Templates and continues until the blue folders. In this case it is New Folder/suda_esx. You can rename and reorganize folders, so datacenter names can vary. To formulate the inventory path, append /vm to the datacenter name, followed by the virtual machine name as it appears where selected. To obtain the path to virtual disk, select disk in the hardware summary, and read the Disk File text box.
This command mounts the virtual disk file covTest.vmdk on Windows drive letter Q:
vmware-mount Q: /v:1 /i:"New Folder/suda_esx/vm/Discovered Virtual Machine/covTest"      "[storage1] covTest/covTest.vmdk" /h:vc.example.com /u:Administrator /s:adminpw

 

Running VMware Disk Mount on a Linux Host

  • 0 Ratings
 
 
Running VMware Disk Mount on a Linux Host
To run Disk Mount, open a command terminal on a Linux host. Disk Mount installs in /usr/bin by default, so you can type just vmware-mount to display usage information. Many mount operations require root (su -) or superuser (sudo) permission.
VMware Disk Mount for Linux offers two modes for mounting disks:
1
You can mount a specific partition of a virtual disk, either local or remote.
The command syntax for mounting a specific partition is as follows; the default partitionNumber is 1:
vmware-mount /path/to/disk [partitionNumber] /mount/point
2
You can mount a flat-file representation of an entire virtual disk.
The command syntax for mounting a flat-file representation is:
vmware-mount -f /path/to/disk /mount/point
Disk Mount includes a number of other options to use with virtual disks and mount points. The command syntax for most options is either of the following:
vmware-mount [option] [/path/to/disk]
vmware-mount [option] [/mount/point]
 
Note VDDK 1.2 incorporated international support so you can specify paths and filenames in Unicode.
In the following list of options, < diskID> is an identifier of the form username@hostname:/path/to/disk for remote disks, or just the /path/to/disk for local disks. Options that mount a remote disk also require the -h, -u, -F, and possibly -v options. The -v option is required when connecting to VMware vCenter.
 
Option
Definition
<diskID> <mountPoint>
Mounts
-p <diskID>
Displays the partitions on a virtual disk.
-l <diskID>
Displays all mounted partitions a virtual disk.
-L
Displays all virtual disks mounted on the host computer.
-d <mountPoint>
Cleanly unmounts this partition, closing disk if it is the last partition.
-f <diskID> <mountPoint>
Mounts a flat-file representation of an entire virtual disk at the specified mount point.
-k <diskID>
Unmounts all partitions on a virtual disk and closes the virtual disk.
-K <diskID>
Forcibly unmounts all partitions on a virtual disk and closes all virtual disks.
-x
Unmounts all partitions and closes all virtual disks.
-X
Forcibly unmounts all partitions and closes all virtual disks.
The options for remote virtual disks are:
 
Option
Definition
-v InventoryPath
Specifies inventory path on the VMware vCenter that manages this virtual disk
-h HostName
Specifies the name or IP address of the ESX host to access the managed virtual disk.
-u UserName
Specifies user name for the ESX host.
-F PasswordFile
Specifies the path name to a plain text file containing the password for the ESX host.
-P Port
Specifies the port number for server connections. Defaults to 902 and is often optional. When connecting to an ESX host or through VMware vCenter, the actual port number comes back from the server. If zero (0), the -P specified port number is used instead.
Log File
On Linux the diagnostic log files for each <user> who ran vmware-mount are located here:
/tmp/vmware-<user>/fuseMount.log
Examples Using VMware Disk Mount on a Linux Host
Following are some examples that illustrate how to use Disk Mount on a Linux host.
To show the partitions on a local virtual disk
Assuming directory /vmware/guest and virtual machine RHEL4, type this command, which produces the following output:
vmware-mount -p /vmware/guest/RHEL4/RHEL4.vmdk
Volume 1 : 102 MB, Linux
Volume 2 : 19862 MB, Linux
Volume 3 : 510 MB, Linux swap
To mount a partition from a local virtual disk
To mount the second partition from above, type this command:
vmware-mount /vmware/guest/RHEL4/RHEL4.vmdk 2 /mnt/rhel4
To mount a remote virtual disk
Type a command in this form, where <VMname> is the guest OS name, <inv> is the inventory path, <srv> is an ESX/ESXi host or vCenter Server name, <user> is a privileged user, and <pfile> is a file containing the user’s password:
vmware-mount -v <inv> -h <srv> -u <user> -F <pfile> "[storage1] <VMname>/<VMname>.vmdk" /mount/pt
Here are two examples, connecting to an ESX/ESXi host and through VMware vCenter:
vmware-mount -v ha-datacenter/vm/RH5 -h esx3 -u root -F pwf "[storage1] RH5/RH5.vmdk" /mnt/rh5
vmware-mount -v Datacenter/vm/RH5 -h vc2 -u admin -F pwf "[storage1] RH5/RH5.vmdk" /mnt/rh5
 
Note ESX/ESXi path names are case-sensitive.
To mount a flat representation of a virtual disk
Use the -f option:
vmware-mount -f /vmware/guest/SUSE10/SUSE10.vmdk /mnt/suse10
To list the currently mounted virtual disks
Use the -L option, with sample output shown below:
vmware-mount -L
Disks with mounted partitions:
/vmware/guest/RHEL4/RHEL4.vmdk   partition2   /mnt/rhel4
root@esx3.example.com:[storage1]RHEL5/RHEL5.vmdk /mnt/rhel5
/vmware/guest/SUSE10/SUSE10.vmdk             /mnt/suse10/flat
To unmount a virtual disk so virtual machines can access it again
You can use the -d option and supply a mount point:
vmware-mount -d /mnt/rhel4
You can also use the -k option and supply a disk ID:
vmware-mount -k root@esx3.example.com:[storage1]RHEL5/RHEL5.vmdk
You may also use the -x or -X option to unmount, or force-unmount, all partitions.
About the Inventory Path
On an ESX/ESXi host with the /i option, specify InventoryPath as:
/i:ha-datacenter/vm/<VMpathname-as-read from-inventory-tree-in-VC-client-UI>
On VMware vCenter with the /i option, specify InventoryPath as:
/i:<Path-to-datacenter>/vm/<VMpathname-as-read from-inventory-tree-in-VC-client-UI>
The path to your datacenter is as read from the tree display in the VMware vCenter UI.
Formulating the Inventory Path
For help with the inventory path on ESX/ESXi hosts or with vCenter Server, see Formulating the ESX Inventory Path or Formulating the VMware vCenter Inventory Path.
Installing the Fuse Package
Fuse (file system in user space) is a loadable kernel module for UNIX operating systems. It allows regular (non-root) users to create and access their own file systems. The file system code runs in user space, while the Fuse module provides a bridge to the actual kernel mount interfaces. Fuse was merged into mainstream Linux in kernel version 2.6.14. For earlier versions of Linux, you might need to install it.
To check if your system has Fuse
Run the modprobe -l command:
modprobe -l fuse
/lib/modules/2.6.22-14-generic/kernel/fs/fuse/fuse.ko
If the second line showing fuse.ko appears, stop.
If no output appears, proceed to one of the sections below.
To install Fuse with APT
On Linux systems that use APT installer, obtain the Fuse package as follows:
sudo apt-get install fuse-utils
Now you can run the vmware-mount command as described in this manual.
To install Fuse from the Web
1
Download Fuse software from the http://fuse.sourceforge.net Web site.
2
Unpack the software and change to the unpacked directory:
tar -zxf <FusePackage>.tar.gz
cd <FusePackage>
3
Configure the makefile for your system and run make to compile it:
./configure
make
4
As superuser, install the package (this puts it in /usr/local/lib):
sudo make install
5
If /usr/local/lib is not listed in /etc/ld.so.conf or an included file, insert a line for it and run the ldconfig command. Alternatively, modify your LD_LIBRARY_PATH environment.
sudo edit /etc/ld.so.conf
sudo ldconfig
6
To mount a remote virtual disk with the -v and -h options, if /usr/lib/vmware-vix-disklib/lib64 or /usr/lib/vmware-vix-disklib/lib32 (depending on remote virtual machine architecture) is not listed in /etc/ld.so.conf or an included file, insert a line for it and run the ldconfig command, as in the previous step.
7
Run the modprobe command to insert Fuse module into the kernel:
sudo modprobe fuse
Now you can run the vmware-mount command as described in this manual.
SSL and Crypto Libraries
On some distributions, especially 64-bit Linux, vmware-mount might produce an error saying “failed to load library libcrypto.so.0.9.8 [or] libssl.so.0.9.8... cannot open shared object file.”
Fuse mount requires these libraries, but does not install them.
If vmware-mount complains about missing libraries
To avoid this problem, add the location of the missing libraries to your LD_LIBRARY_PATH environment, as in this example, and run vmware-mount again:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:    /usr/local/lib/vmware/lib/libcrypto.so.0.9.8:/usr/local/lib/vmware/lib/libssl.so.0.9.8
ldd /usr/bin/vmware-mount
vmware-mount
The first two lines constitute a single command, so type Enter only after 0.9.8. The ldd command is diagnostic, to verify dependencies.

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM