將影像檔(VMware, QEMU)安裝到硬碟

將影像檔(VMware, QEMU)安裝到硬碟

QEMU using lxde 的經驗之後 覺得這個img不錯用,想要把他直接安裝到硬碟 用轉換的方式 作法如下 看看lxde.img 是哪種格式 qemu-img info lxde.mg image: lxde.img file format: qcow virtual size: 4.0G (4294967296 bytes) disk size: 549M 轉換格式成"raw" 可以掛進loop qemu-img convert -f qcow lxde.img -o raw lxde_raw.img 使用loop的mod modprobe loop 掛進loop device losetup /dev/loop0 lxde_raw.img 把硬碟接上去,我暫時用usb接,所以裝置是sda 用dd的方式複製 dd if=/dev/loop0 of=/dev/sda 用QEMU 測試硬碟可不可以開機 qemu /dev/sda 大功告成 把主機接上硬碟就可以用 此外 qemu-img 也有支援vmware3, vmware4的影像檔 *.vmdk 所以原則上vmware也可以這樣的方式複製到實體機器 qemu支援的影像檔 fmt is the disk image format. It is guessed automatically in most cases. The following formats are supported: "raw" Raw disk image format (default). This format has the advantage of being simple and easily exportable to all other emulators. If your file system supports holes (for example in ext2 or ext3 on Linux), then only the written sectors will reserve space. Use "qemu-img info" to know the real size used by the image or "ls -ls" on Unix/Linux. "qcow" QEMU image format, the most versatile format. Use it to have smaller images (useful if your filesystem does not supports holes, for example on Windows), optional AES encryption and zlib based compression. "cow" User Mode Linux Copy On Write image format. Used to be the only growable image format in QEMU. It is supported only for compat‐ ibility with previous versions. It does not work on win32. "vmdk" VMware 3 and 4 compatible image format. "cloop" Linux Compressed Loop image, useful only to reuse directly com‐ pressed CD-ROM images present for example in the Knoppix CD-ROMs.

convert from Thomas blog post id 42 old convert log: ./094200/tag%3E2007%2001%20linux)

@2007 @01 @linux

Comments