| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 30 | 31 | 1 | 2 | 3 | 4 | 5 |
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 1 | 2 | 3 | 4 |
Editing files in VMWare disk images
Submitted by Falken on Tue, 07/07/2009 - 09:35
Rather annoyingly VMWare's 'vmware-mount' command mounts the image read-only, so if, for instance, you need to remove the device drivers that make VirtualBox choke, you can't.
This is easy enough to get around, however:
# vmware-mount -f /home/chivertont/.VirtualBox/HardDisks/Windows\ XP/Windows\ XP\ Professional.vmdk /mnt/loopback/
# mount -t ntfs-3g -o loop,offset=32256,context= /mnt/loopback/flat /mnt/t
$LogFile indicates unclean shutdown (0, 0)
Failed to mount '/dev/loop0': Operation not supported
Mount is denied because NTFS is marked to be in use. Choose one action:
Choice 1: If you have Windows then disconnect the external devices by
clicking on the 'Safely Remove Hardware' icon in the Windows
taskbar then shutdown Windows cleanly.
Choice 2: If you don't have Windows then you can use the 'force' option for
your own responsibility. For example type on the command line:
mount -t ntfs-3g /dev/loop0 /mnt/t -o force
Or add the option to the relevant row in the /etc/fstab file:
/dev/loop0 /mnt/t ntfs-3g defaults,force 0 0
Well, I'm working on a copy of the image, so let's just go for it:
# mount -t ntfs-3g -o loop,offset=32256,context=,force /mnt/loopback/flat /mnt/t
$LogFile indicates unclean shutdown (0, 0)
WARNING: Forced mount, reset $LogFile.
# mv t/WINDOWS/system32/drivers/AGP440.SYS t/WINDOWS/system32/drivers/AGP440.SYS.old
# mv t/WINDOWS/system32/drivers/intelppm.sys t/WINDOWS/system32/drivers/intelppm.sys.old
Now we just need to unmount everthing. This went a big gaga but was fine in the end. I used 'lsof' to check nothing was really using it and killed it.
# umount /mnt/t
# vmware-mount -d /mnt/loopback/
umount: /mnt/loopback: device is busy
umount: /mnt/loopback: device is busy
Failed to unmount partition '/mnt/loopback/': umount command failed
# sync
# vmware-mount -d /mnt/loopback/
umount: /mnt/loopback: device is busy
umount: /mnt/loopback: device is busy
Failed to unmount partition '/mnt/loopback/': umount command failed
# lsof +D /mnt/loopback
# ps -efw|grep vmw
root 3060 1 1 16:32 ? 00:00:03 vmware-mount -f /home/chivertont/.VirtualBox/HardDisks/Windows XP/Windows XP Professional.vmdk /mnt/loopback/
root 3132 5580 0 16:35 pts/1 00:00:00 grep vmw
# kill 3060




Recent comments
3 days 20 hours ago
1 week 14 hours ago
5 weeks 1 day ago
19 weeks 2 days ago
24 weeks 2 days ago
27 weeks 1 day ago
27 weeks 2 days ago
30 weeks 16 hours ago
31 weeks 3 days ago
31 weeks 6 days ago