But I quickly realized that the offset written by makebootable was from the start of the physical disk, while the vmdk contains only this one partition so the offset is from start of the partition. Understadable, though a bit inconvenient if I want to switch between bare metal and virtualized environment where all drivers work fine.IIRC you can set the vmdk to have the partition at the same offset in a larger disk so it fits.
Indeed so. I've got a triple-boot setup on my macbook, and VMDKs so I can virtualise the other 2 from OS X. The important bit of the VMDK to boot my Linux partition looks like this:
# Extent description RW 40 FLAT "disk0.gpt" 0 RW 409600 ZERO RW 429158128 ZERO RW 262376 ZERO RW 97654784 FLAT "/dev/disk0s3" 0 RW 75765760 ZERO RW 2048 ZERO RW 19529728 FLAT "/dev/disk0s5" 0 RW 2048 ZERO RW 1024 FLAT "grubmain" 0 RW 2356224 ZERO RW 655 ZERO RW 33 FLAT "disk0.gpts" 0A somewhat complicated setup - grub is installed to a partition, and linux has a separate swap partition, and as it's a GPT disk there are partition tables at the beginning and end of the drive. Hopefully you can see that raw access to partitions 3 and 5 are given at the same part in my virtual drive as on the physical one, but access to sectors in the other partitions will just be no-ops.