blob: cf72d2c376086ff082a4dd7abf335473397468b8 [file] [log] [blame]
Alex Savatieievec703692019-06-07 15:33:31 -05001# package
2apt-get install qemu-utils
3
4#image
5wget https://cloud-images.ubuntu.com/releases/14.04.1/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img
6
7# adding module
8modprobe nbd
9dmesg | grep nbd
10
11# mapping it
12qemu-nbd --connect=/dev/nbd0 /home/osavatieiev/ubuntu-14.04-server-cloudimg-amd64-disk1.img
13blockdev --rereadpt /dev/nbd0
14mkdir /mnt/target_vm
15mount /dev/nbd0p1 /mnt/target_vm
16
17# download iperf just in case
18wget http://archive.ubuntu.com/ubuntu/pool/universe/i/iperf/iperf_2.0.5-3_amd64.deb
19cp iperf_2.0.5-3_amd64.deb /mnt/vm/tmp/
20
21chroot /mnt/target_vm/
22
23# add user
24adduser spt
25usermod -aG sudo spt
26dpkg -i /tmp/iperf_2.0.5-3_amd64.deb
27
28# ctrl + D
29# disconect
30umount /mnt/target_vm
31qemu-nbd --disconnect /dev/nbd0