-
Senior Member
registered user
Running VMs from Poor Man's Installs with qemu/kvm
One advantage of the combination of Knoppix and Qemu/kvm is that it is not necessary to do any setup of a virtual machine to run Knoppix, and with Knoppix copies on separate partitions bootable with grub, one may simply run gemu/kvm on the MBR of the harddisk and pick the desired install from the ordinary grub boot menu. The actual partition should be mounted read-only at most, as it gets mounted on /mnt-system in the virtual machine.
One complication with qemu/kvm is only simple networking support out of the box: I can reach the internet through the host, default network-manager works just fine for that, but direct communication with the Knoppix guest system isn't set up. Furthermore, with wireless adapters, the traditional simple bridge techique doesn't work.
There are lots of ways to overcome this, and here I want to report just one rather simple, presented in the blog post http://yalb.blogspot.no/2012/04/wire...g-for-kvm.html
It uses the tunctl, from uml-utilities, and parprouted from parprouted
In this case, my internet connection is through a mobile router (192.168.1.1) and wlan0 (192.168.1.100). The guest must be on the same subnet.
I issued the following commands
Code:
sudo sysctl -w /net/ipv4/ip_forward=1
sudo tunctl -t tap0
sudo ip link set tap0 up
sudo ip addr add 10.10.10.10/32 dev tap0
sudo parprouted wlan0 tap0
Then I started qemu/kvm to boot an ordinary Knoppix PMI through grub:
Code:
sudo qemu -machine accel=kvm -hda /dev/sda -net nic -net tap,ifname=tap0,script=no -m 1024 &
In the guest, disable network-manager's networking and setup the virtual eth0, as root:
Code:
ifconfig eth0 192.168.1.99 up # Static IP
echo 'nameserver 192.168.1.1' > /etc/resolv.conf # Use the nameserver of the host
route add default gw 192.168.1.100 # Host IP
Somewhat miraculously to me, this worked!
I haven't tried yet, but this should work for at least a few VM's, creating tap1, tap2 etc and using them instead of tap0.
This way, servers can be tested out or routinely run with qemu/kvm just by copying the KNOPPIX directory (to be precise, in this case KNOPPIX705R1, remastering 1 of 7.0.5) to a partition (which may contain just about anything besides), setting up a grub menu entry for the copy and run qemu/kvm.
My practical motivation for this is to run a database server and a web server on separate virtual machines, possibly an application server too. With three extra partitions, I can easily run three VMs simulataneously this way.
I have used VMware Workstation for this earlier, but this approach seems both simpler and more flexible to me. Plus I can spare myself the frequent VMware module compilation blues. (Workstation 8.0.5 works fine with Knoppix 7.0.5, BTW - Workstation 8.0.4 does not.)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Intel Core i7-10700T 2.00GHz 8-Core SRH6U 16-Thread LGA-1200 Processor
$539.96
Supermicro 4U 4x Nvidia GPU AI Server 3.8Ghz 8-Core 64GB 2x10G SFP+ 2x2200W
$3180.00
Supermicro 4U 4x Nvidia GPU AI Server 3.6Ghz 8-Core 256GB 2x10G SFP+ 2x2200W
$1732.00
Supermicro 4U 4x Nvidia GPU AI Server 2.6Ghz 8-Core 256GB 2x10G SFP+ 2x2200W
$1382.00
Intel - Core i9-13900K 13th Gen 24 cores 8 P-cores + 16 E-cores 36M Cache, 3 ...
$689.99
Intel - Core i9-12900K Desktop Processor 16 (8P+8E) Cores up to 5.2 GHz Unloc...
$619.99
Intel - Core i7-13700K 13th Gen 16 cores 8 P-cores + 8 E-cores 30M Cache, 3.4...
$489.99
Apple iMac Pro 2017 27 Inch 5K 3.2 GHz 8-Core Xeon 64GB RAM 1TB Vega
$1295.00
ALLEGIANCE Desktop Computer Gaming PC: Intel 8 Core 128GB RAM, 2TB SSD, GeForce
$687.99
FAST Dell TOUCHSCREEN 8th Gen Intel Quad Core 16GB RAM Pick SSD Wi-Fi BT Win11
$175.00