Is there a command-line tool to extract files from a VMDK file? WinImage seems to be able to do it, but it's GUI only.
Asked
Active
Viewed 3.1k times
4 Answers
7
7ZIP is able to open and extract VMDK files. You may try out its command-line version.
-
1Only seems to work if the VMDK is one single file. For VMDKs split into chunks (e.g. to stay below 2-GB limit), 7-zip tells me "file cannot be opened as an archive" – Jonas Heidelberg Dec 29 '18 at 00:42
4
Mount the VMDK using VMware's Disk Mount utility, then copy the file you want, then unmount it.
See this page: http://www.vladan.fr/mounting-your-vmdk-disks-directly-to-your-windows-box-how-to/
pepoluan
- 4,918
- 3
- 43
- 71
2
Use 7zip with full path extraction to folder:
7z x -o<destination-folder> box-disk1.vmdk
Sergey Bezugliy
- 121
- 4
1
Using the guestmount
command on linux works for me. I'm able to mount both an Ubuntu VM with multiple .vmdk files and a Windows10 VM with a single .vmdk like this:
sudo apt-get install libguestfs-tools
guestmount --help
sudo mkdir /mnt/u1 /mnt/u2
sudo guestmount -i -r /mnt/u1 -a ~/vmware/Ubuntu1804/Ubuntu.vmdk #1st .vmdk
sudo guestmount -i -r /mnt/u2 -a ~/vmware/Windows10/Windows10-disk1.vmdk
sudo cat /mnt/u1/etc/lsb-release #see if ubuntu vm file is readable
sudo cat /mnt/u2/Windows/system.ini #see if windows vm file is readable
sudo guestunmount /mnt/u1
sudo guestunmount /mnt/u2
Kjetil S.
- 181
- 3