terça-feira, 11 de junho de 2019

Creating a debian image

sudo fdisk -l <name>.img    Start
     value size
sudo mount -v -o offset=<value size * 512> -t ext4 ./<name>.img <path>


qemu-img create debian.img 750M
#or use qcow format for smaller image
qemu-img create -f qcow debian.qcow 750M
 
qemu -cdrom debian-40r3-i386-businesscard.iso -hda debian.img -boot d

resizing qemu image
# create a copy of the image in raw format
qemu-img convert debian.img -O raw debian.raw
# Expand the raw image to 750MB by padding with zeroes
# obs=block_size. seek=nb block size of expanded image. So here 750*1MB = 750 MB
dd if=/dev/zero of=debian.raw seek=750 obs=1MB count=0
# recompress the raw image into in qemu format(qcow), uses only space needed.
qemu-img convert debian.raw -O qcow debian_new.img
#test new image
qemu -hda debian_new.img
# cleanup
rm debian.raw
mv debian_raw.img debian.img

http://wiki.colar.net/creating_a_qemu_image_and_installing_debian_in_it

Nenhum comentário:

Postar um comentário