qemu/kvm, user management, create, launch, create a bridge, use a bridge

Hi,
Believe you have an error in your repo URI, here is the zypper command with the corrected URI to do what you describe although I strongly recommend never creating labels with spaces in the names unless there is a good reason to do so…

zypper ar -f https://download.opensuse.org/repositories/home:/frispete:/15.2:/kvm/openSUSE_Leap_15.2/ "Current KVM Builds"

As for your modifications to get your desired screen resolution,
I’m pretty sure if you set that resolution in your Guest the first time you run your machine and then poweroff,
The next time you boot up, your settings will be remembered and default settings should automatically re-size your console.

Good stuff…

TSU

I get an answer from qemu team about “qemu does not take care automatically of the kernel option “vga=1280x960”.
I must in “view” menu of the vm uncheck “zoom to fit” to get a window of size 1290x960.” in case you use 3d accel.

you must use

-device virtio-vga,virgl=on -display gtk,gl=on,zoom-to-fit=off \

If you get by default a time which is not the host time, then use this statement.

-rtc base=localtime,clock=host

More info about “I want the VM is another PC in my LAN” <=> “I want for the VM a LAN ip address”.

I used “-nic bridge” statement. This work if you launch only one VM. In this case the VM get the mac address of the slave of the bridge, in my case “eth0”. The ip address is associated to this mac address.

If you want to launch several VMs then each one get the same mac address (the one of “eth0”) thus the same ip address !

This leads to problems :

  • downloading sucks
  • no ipv6 address, only ipv4 address

Solution :

Each VM must have its own mac address.

Replace “-nic bridge” by “-nic bridge,mac=00:16:3e:09:08:5b”

“00:16:3e:09:08:5b” is an example.

I use macgen.py [FONT=monospace] from Redhat to generate mac addresses.

Certainly you can find one by googling.[/FONT]

Here is one :

https://gist.github.com/viz3/6591201

Some news about graphic acceleration.

With recent version of Qemu "-device virtio-vga,virgl=on -display gtk,gl=on,zoom-to-fit=off " does not work anymore.

Accurately, “device virtio-vga,virgl=on” is obsolete.

We must use “-device virtio-vga-gl”

see https://www.kraxel.org/blog/2021/05/virtio-gpu-qemu-graphics-update/

then the good statements are :

-display gtk,gl=on,zoom-to-fit=off
-device virtio-vga-gl \

Enjoy

Graphic acceleration.

For some VM for example openSUSE tumbleweed don’t use “zoom-to-fit=off” this leads to screen size problem.

For some VM for example android 7.1-r5 from https://www.android-x86.org/ the graphic acceleration leads to the apps does not detect the webcam then don’t use it. Graphic acceleration was running well with previous version of qemu.

I check that with openSUSE Tumbleweed VM the graphic acceleration works well.
I checked with glxinfo that virgl is well acitvated and the webcam runs well.

Webcam using

I switched to from openSUSE Argon Leap 15.3 to openSUSE Tumbleweed.

Result : with WhatsApp no more access to the webcam !

I had to change the udev rules about my webcam to get again access to the webcam. Accurately, I replaced <MODE=“0664”> by <MODE=“0777”>.

Some news about udev rules

If your OS does not take care of your udev rule then replace <MODE=“0664”> by <MODE:=“0664”>

“:=” forbid any replacement by the OS

About Bluetooth devices

QEMU does not share a Bluetooth device then as for the webcam you must use a dedicated Bluetooth device

you must add the udev rule, in the /etc/udev/rules.d/50.qemu.rules file, the statement

SUBSYSTEMS==“usb”, ATTRS{idVendor}==“vendor_id”, ATTRS{idProduct}==“product_id”, GROUP=“kvm”, MODE:=“0666”

If you use an android-x86 QEMU VM

you must enable the Bluetooth service

with the “terminal” app

check the device is there with the command:

hciconfig -a

enable bluetooth with the commands:

su root pm disable com.android.bluetooth
su root pm enable com.android.bluetooth

perhaps you must restart the VM

activate the Bluetooth with the GUI or the Bluetooth settings

A new thing :

The file qemu-bridge-helper is now in /usr/libexec/

1 Like

Thanks for still keeping this updated.
I configured virtualization using Yast and only needed to add my user to the kvm & libvirt groups, but it’s both gratifying and scary to see all the commands to set it up manually. :slightly_smiling_face:

1 Like

@pavinjoseph
Perhaps I will try your solution, if it simplifies my method.

Don’t forget, I use my method because I need to launch automatically a VM at login. I can’t do this using libvirt tools because we need root access to launch a VM.

If with your method I don’t need any root access, then I will overhaul my method.

Today my method runs well, so I am not inclined to change it.

If your user is in the qemu,libvirt,kvm groups, then they won’t need elevated privileges to create/run VMs.

Yes and no need to alter the acl of some files as qemu-bridge-helper.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.