Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
creating a debian VM
* qemu-img create -f raw debian-disk.raw 8G
* fdisk debian-disk.raw
** create 1 primary partition
* kpartx -av debian-diak.raw
* mkfs.ext3 /dev/mapper/$disk
* mount /dev/mapper/$disk /mnt/debian
* debootstrap wheezy /mnt/debian
* chroot /mnt/debian
* apt-get install grub2 vim linux-image-amd64 udev openssh-server
* create fstab
* create /etc/network/interfaces
* edit hostname hosts
* exit
* grub2-install --boot-directory=/mnt/debian/boot /dev/loop0
* create grub.cfg
* sync
* umount /mnt/debian
* kaprtx -d debian-diak.raw
start the vm and check it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment