Vmware mount vmdk linux

Монтирование .vmdk-диска виртуальной машины VMware в Linux

Иногда обмен файлами между виртуальной и хостовой операционными системами может стать проблемой (по крайней мере, у меня такое не раз бывало). Штатные средства на уровне гостевой ОС требуют установленных VMware-Tools, дополнительных настроек виртуальной сети и т.п.

А что делать, если нам просто нужно перекинуть небольшой файл из хостовой ОС Linux на диск виртуальной машины, но шаманить с тулзами и дополнительными настройками нету ни времени ни желания?

Как по мне, простейший способ сделать это — выключить ВМ (если есть возможность) и смонтировать ее виртуальный диск в хостовую ОС. О том как я это делал — ниже.

Итак, все происходило на моем любимом Дебиане 5.0 с установленным на нем VMware Server 2. На VMware крутится Windows 7.

У VMware Server для таких целей есть тулза vmware-mount, которая расположена в папке с самим гипервизором. Принцип ее использования достаточно прост:

./vmware-mount [номер раздела]

«путь к файлу диска» — это путь к самому .vmdk файлу нашей виртуальной машинки, который, как правило, расположен в папке с самой виртуальной машиной;

«номер раздела» — номер логического раздела на диске, начинается, по ходу с «1» т.к. «0» и «1», в моем случае, были загрузочным сектором, а раздел номер «2» был собственно разделом с виндой;

«точка монтирования» — папка, в которую хотим примонтировать наш диск;

Собственно у меня получилась вот такая команда:

$ sudo ./vmware-mount /var/vm-machines/windows7/windows7.vmdk 2 /mnt/windows7

что бы отмонтировать это дело, я не додумался до чего-то более умного чем:

Возможные ошибки (куда же без них):

Для начала, тулза не хотела ничего монтировать и вылетала с ошибкой:

./vmware-mount: error while loading shared libraries: libfuse.so.2: cannot open shared object file: No such file or directory

пофиксилось установкой 2-х пакетов: fuse-utils и libfuse2:

$ sudo apt-get install fuse-utils

но это не все, дальше появилась еще одна ошибка:

SSLLoadSharedLibrary: Failed to load library libcrypto.so.0.9.8:/vmserver/libdir/lib/libcrypto.so.0.9.8/libcrypto.so.0.9.8: cannot open shared object file: No such file or directory Core dump limit is 0 KB. Child process 16980 failed to dump core (status 0x6). VMware Server Error: VMware Server unrecoverable error: (app) SSLLoadSharedLibrary: Failed to load library libcrypto.so.0.9.8:/vmserver/libdir/lib/libcrypto.so.0.9.8/libcrypto.so.0.9.8: cannot open shared object file: No such file or directory Please request support. To collect data to submit to VMware support, select Help > About and click "Collect Support Data". You can also run the "vm-support" script in the Workstation folder directly. We will respond on the basis of your support entitlement. Press "Enter" to continue.

Насколько я понял,связана она с тем, что VMware Server у меня был установлен не в /usr, а в /vmserver, а если конкретней, то сами библиотеки ВМтвари расположены не в /usr/lib/vmware а в /vmserver/lib/vmware. Пофиксить это достаточно просто, нужно создать симлинк на наши библиотеки:

$ sudo ln -s /vmserver/lib/vmware /usr/lib/vmware

vmserver в моем случае, это папка, в которую установлены быблиотеки гипервизора и сам гипервизор (инсталяциооный скрипт в процессе установки VMware сервера, спрашивает куда их устанавливать).

Читайте также:  Build linux distro on windows

Источник

How to mount VMDK-image in Linux

Понадобилось мне Windows в эмуляторе VirtualBox поставить, выбрал VMDK. Теперь хочу вытащить файлы оттуда, подмонтировав VMDK-образ в Дебиане. Пока вижу такой путь: qemu-img convert . && mount -o ro,loop .

Есть ли какой-то другой способ? Утилита xmount, по-моему, такого не умеет.

# qemu-img --help qemu-img version 1.1.2 . Supported formats: vvfat vpc vmdk vdi sheepdog raw host_cdrom host_floppy host_device file qed qcow2 qcow parallels nbd iscsi dmg tftp ftps ftp https http cow cloop bochs blkverify blkdebug

у тебя qemu за сентябрь 2012 года.

В общем, я решил простым способом — конвертировал образ в raw, затем

# fdisk -l hdd.raw # mount -o loop,ro,offset= hdd.raw VBox/

Просто интересовали какие-то прямые способы без конвертации. Я нашёл упоминание, что есть проприетарные утилиты для этого под Windows, MacOS (от VMWare).

Странно, что ты не вбил заголовок треда в гугл, вопрос сформулирован абсолютно правильно. И самый первый линк в выдаче дал

sudo mount vmware-server-flat.vmdk /tmp/test/ -o ro,loop=/dev/loop1,offset=32768 -t ntfs

Mount a VMware virtual disk (.vmdk) file on a Linux box

Assumes XP/2000/2003. For Server 2008+ try offset=105,906,176 You can find this number in the System Information utility under Partition Starting Offset. UEFI based boxes you want partition 2 since the first is just the boot files (and FAT). This works with (storage side) snapshots which is handy for single file restores on NFS mounted VMware systems

И кучу альтернативных вариантов, без ожидания кучи времени на конвертацию.

И кстати, за это я не люблю Дебиан, полный древними ископаемыми. Взглянув на версии софта, так и хочется заменить «ШГ» на «УГ» рядом со словом Debian на твоей аве.

Читайте также:  Wifi deauth kali linux

fehhner ★★★★★ ( 24.11.16 02:15:16 MSK )
Последнее исправление: fehhner 24.11.16 02:18:08 MSK (всего исправлений: 1)

Источник

Vmware mount vmdk linux

You are using an outdated browser. Please upgrade your browser to improve your experience.

When you map a virtual disk and its associated volume to a drive on the host system, you can connect to the virtual disk without opening a virtual machine.

After you map the virtual disk to a drive on the host system, you cannot power on any virtual machine that uses the disk until you disconnect the disk from the host system.

Important: If you mount a virtual disk that has a snapshot and then write to the disk, you can irreparably damage a snapshot or linked clone created from the virtual machine. Note that Workstation Player does not support taking snapshots or deleting them.

Mapping a virtual disk to a host system is not supported in the standalone version of Workstation Player . Virtual disk mapping is supported in the Workstation Player version included with Workstation Pro.

Prerequisites

  • Power off all virtual machines that use the virtual disk.
  • Verify that the virtual disk ( .vmdk ) files on the virtual disk are not compressed and do not have read-only permissions.
  • Verify that the virtual disk is unencrypted. You cannot map or mount encrypted disks.

Procedure

  1. Select the virtual machine and select Virtual Machine > Virtual Machine Settings .
  2. On the Hardware tab, select Hard Disk , click Utilities , and select Map .
  3. On a Linux host, select the Mount in read-only mode check box in the Mount Disk dialog box.

This setting prevents you from accidentally writing data to a virtual disk that might be the parent of a snapshot or linked clone. Writing to such a disk might make the snapshot or linked clone unusable.

Читайте также:  Архитектура ос linux кратко

The drive appears on the host system. You can read from or write to files on the mapped virtual disk on the host system.

Источник

Mount VMWare Disk Images Under Linux

Is it still possible to mount VMWare disk images under Linux? I found the following two articles, both of them recommend to use kpartx -av diskimage-flat.vmdk . However both the articles are old and, when I try it on my Ubuntu Utopic 14.10, it no longer works any more.

$ sudo kpartx -av MyWin81.vmdk $ sudo ls /dev/mapper/loop* | wc -l ls: cannot access /dev/mapper/loop*: No such file or directory 0 

Disclosure: My VMWare disk image IS a flat disk image. Furthermore (before you recommend loop mount), it is a multi-partition disk image, with first partition being Window8 and next two in Linux. It is the next two Linux partitions that I’m more interested to work on. Can someone confirm please? Thanks. Mount Flat VMWare Disk Images Under Linux http://cromoteca.com/en/blog/mountflatvmwarediskimagesunderlinux/ Mount a VMware virtual disk (.vmdk) file on a Linux box http://www.commandlinefu.com/commands/view/12554/mount-a-vmware-virtual-disk-.vmdk-file-on-a-linux-box UPDATE: vmware-mount looks very promising, but I can’t get it working yet:

$ vmware-mount -p Win81.vmdk VixDiskLib: Invalid configuration file parameter. Failed to read configuration file. Nr Start Size Type Id Sytem -- ---------- ---------- ---- -- ------------------------ 1 2048 78643200 BIOS 7 HPFS/NTFS 2 78645248 6039552 BIOS 83 Linux 3 84684800 41144320 BIOS 83 Linux % vmware-mount Win81.vmdk 1 /mnt/tmp1/ VixDiskLib: Invalid configuration file parameter. Failed to read configuration file. Failed to mount partition 1 of disk 'Win81.vmdk' on '/mnt/tmp1/': Insufficient permissions to perform this operation % vmware-mount -L VixDiskLib: Invalid configuration file parameter. Failed to read configuration file. No mounted disks. $ vmware-mount | head -3 VixDiskLib: Invalid configuration file parameter. Failed to read configuration file. VMware DiskMount Utility version 6.0.0, build-2496824 Usage: vmware-mount diskPath [partition num] mountPoint 

NB, the 2nd and 3rd command is run directly as root , yet I get «Insufficient permissions to perform this operation«?

Источник

Оцените статью
Adblock
detector