- This blogpost will be a quick manual how to create virtual machines for different cpu types:
- Install dependencies
- Setting sudoers for qemu execution on HOST
- How to take snapshot, you need to add to your qemu command -monitor stdio
- create hdd
- VM snapshot with static IP address.
- Install VM per architecture
- WIP:arm64, armel, armhf, mips, mipsel, powerpc, s390x
- Bible to solve issues
- Utils:
- Network setup on host
This blogpost will be a quick manual how to create virtual machines for different cpu types:
- arm64
- armel
- armhf
- mips
- mipsel
- powerpc
- ppc64el
-
s390x
-
amd64 and i386 are omited due that is very simple :)
Install dependencies
- I have script to install everything kvm-qemu.sh
Setting sudoers for qemu execution on HOST
visudo Cmnd_Alias QEMU_CMD = /usr/bin/qemu-*, /sbin/ip, /sbin/ifconfig, /sbin/brctl cape ALL=(ALL) NOPASSWD: QEMU_CMD
How to take snapshot, you need to add to your qemu command -monitor stdio
- -monitor stdio
(qemu)
- Save the VM state typing the following qemu commands in the qemu console:
(qemu) savevm init
- Quit the QEMU console:
(qemu) q
create hdd
- qemu-img create -f qcow2 ubuntu.img 16G
VM snapshot with static IP address.
Setting static ip in guest
nano /etc/network/interfaces auto eth0 iface eth0 inet static address 192.168.X.X netmask 255.255.255.0 gateway 192.168.X.1 dns-servers 1.1.1.1 1.0.0.1
sudo nano /etc/resolves.conf nameserver 1.1.1.1 sudo nano /etc/resolvconf/resolv.conf.d/head nameserver 1.1.1.1
/etc/init.d/networking restart
Install VM per architecture
PowerPC/PowerPC64/PowerPC64el
-
Installation
wget http://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04.4-server-ppc64el.iso qemu-img create -f qcow2 ubuntu-ppc.qcow2 16G qemu-system-ppc64 -m 1024 -hda ubuntu-ppc.qcow2 -boot d -cdrom ubuntu-18.04.4-server-ppc64el.iso
-
Start vm
qemu-system-ppc -m 1024 -hda ubuntu-ppc.qcow2
WIP:arm64, armel, armhf, mips, mipsel, powerpc, s390x
Bible to solve issues
* https://www.evonide.com/non-root-gpu-passthrough-setup/
-
SLR related issue, add:
- -nographic
-
If keyboard doesnt work
- execute
lsusb
and add to qemu command -device usb-host,hostbus=2,hostaddr=1 - http://stackoverflow.com/questions/19665412/mouse-and-keyboard-not-working-in-qemu-emulator/19679327#19679327
- execute
-
Static IP:
- -append “ip=x.x.x.x”
- http://blog.elastocloud.org/2015/07/qemukvm-bridged-network-with-tap.html
Utils:
-
To connect to tty: $ minicom -D /dev/pts/6
-
set iface up/down: $ ip link set dev
up/down -
to see ipaddr $ ip addr show
Network setup on host
-
allow br0 $ echo “allow br0” > /etc/qemu/bridge.conf
-
Add the following config to /etc/qemu-ifup, backup the original if you already have one:
- code can be found in QEMU/qemu-ifup
chmod 755 /etc/qemu-ifup
useles if you use cape/cuckoo rooter, but useful to activate access to some vms during instalation
echo 1 > /proc/sys/net/ipv4/ip_forward iface=$(route | grep '^default' | grep -o '[^ ]*$') iptables -t nat -A POSTROUTING -o $iface -j MASQUERADE iptables -I FORWARD 1 -i tap0 -j ACCEPT iptables -I FORWARD 1 -o tap0 -m state --state RELATED,ESTABLISHED -j ACCEPT
No hay comentarios:
Publicar un comentario