QEMU-KVM - How to modify default address spaces and related services?

Hello,

Looking for detailed instructions how to modify the <default> address space and maybe other settings for User Mode Networking in QEMU-KVM. Looked around and so far unable to find clear instructions.

Problem:
Had QEMU-KVM working more or less as expected for a few days…
Then the Public Network I frequently connect to changed their address space to the Default Class A Private network using the default subnet mask, grabbing <all> addresses.

For those who may not be familiar with the Default Class A Private Network space, if you use the default subnet mask there is only one possible network while maximizing the number of possible Host addresses.

The result is if you have any <other> networks behind the Shared Network to the Internet also configured with a Class A network, all of a sudden routing is impossible because both/all networks share the same address space. This impacts QEMU-KVM because its virtual networks are all by default configured with Class A Private Network address spaces.

The Required Fix:
So, it looks like I need to modify the network settings for my virtual networks and I need step by step instructions. The first network I want to modify is User Mode Netoworking.

First Attempt:
Found the openSUSE QEMU-KVM page
https://doc.opensuse.org/documentation/htmlsingle/openSUSE/opensuse-kvm.html#ex.qemu.net.usermode.iprange

Based on that info, attempted to change to a Class B Private Network

qemu-kvm -net user,net=176.27.0.0/12,host=176.27.2.2,dhcpstart=176.27.0.20

But it seems that command only launches a VM likely with new settings, complaining about “no NIC found” which was really surprising since I don’t think the command can be confused with launching a VM (unless someone sees an error in my command).

TIA,
TSU

All of my networks (I have three… all basically in the C-class or /24 in
CIDR notation) were defined with virt-manager for my KVM setup (on this
laptop). I set them up to match VMware’s in number, so br0 is bridged (I
seldom use this one), br8 is NAT’d and br1 is host-only (rarely use this
one either). I then tell my new VMs to connect to one or the other and
that seems to be fine.

Assuming KDE:
kdesu virt-manager
Choose the local system
Virtual Networks (tab)
Add new networks (‘plus’ sign at the bottom, left-hand side).
Set networks to start on boot, if desired.

VMs start like this:

qemu-system-x86_64 -smp 1 -m 2048 -usb -hda
/home/me/vm/kvm/w2k8r2sp1-a/w2k8r2sp1-a-disk0 -cdrom
/home/me/vm/iso/en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso
-boot order=c -net nic,vlan=0,model=e1000,macaddr=ac:d3:58:ae:8e:ac -net
tap,ifname=kvmtap8022,script=no,vlan=0 -usbdevice tablet -vga std -vnc
127.0.0.1:50 --enable-kvm -name “Windows 2008 R2 SP1 a”

sudo /sbin/tunctl -u me -t kvmtap8022

sudo /sbin/ifconfig kvmtap8022 up 0.0.0.0 promisc

sudo /sbin/brctl addif br8 kvmtap8022

Good luck.

Ab

Thx for the response but unfortunately until I can resolve modifying the default address spaces I seem to have also lost any capability to manage/modify virtual networks using virt-manager and although I haven’t checked feel it’s likely the virt-manager situation probably means that CLI will be blocked, too.

Still haven’t found any solution, also fixing User Mode Networking would probably be more useful than configuring defined virtual networks since this is on a traveling laptop.

TSU

A minor update for anyone who might follow in my footsteps…

First,
I have finally found why “User Mode Networking” is called by that name. Seems for awhile but finally completed last month (Dec 2012) QEMU-KVM has “fully” integrated support for a rather “new” type of virtualization, User Mode Linux.

The User-mode Linux Kernel Home Page

This explains in part why I’ve gotten absolutely no answers in any virtualization, mailing list, QEMU or other forum/mailing list… It’s new, it’s different and is not like the previous technology in QEMU or KVM despite the extreme similarities in the base technology and approach.

The technology seems to be a game-changer, although very new and not widely recognized, or known to this point. There is very little activity on its support boards which may be an indication of its use but IMO it’s rightfully a very important alternative to all other virtualization technologies out there.

In a nutshell:
You can specify different kernels in combination with different backing files. I’m still exploring if it natively supports more than COW and RAW fs formats.

Launching and configuring from the CLI is very simple and even shorter than QEMU_KVM at the moment.

Am still investigating, but unlike QEMU-KVM documentation seems that networking can be implemented with existing or on demand created TAP devices, and <does not need a BR device> (that I’ve seen yet). Exactly what I’m looking for. There are also a half dozen or so supported networking technologies.

I suspect I’ve found the coding problem that may expose a design flaw restricting network address flexibility using QEMU-KVM, but I have not seen any such problem just running UML.

Like QEMU-KVM, USB device support is problematic today. Do not know why USB pass-through is so flakey and supports only USB 1.1. USB “redirection” seems to be the approach with more promise and is its own standalone technology that is useful even in other non-virtualization scenarios.

No libvirt, virt-manager or virt-install support. Has its own “console” but is very new and limited today. So, for the moment CLI is best to launch, configure and tear down.

Those are my current and first impressions,
TSU