Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

11 votes
1 answers
3838 views
KVM clipboard sharing with client running Wayland
I have Fedora 35 installed as a VM, with `Qemu/KVM` as the hypervisor and `virt-manager` as the graphical front-end, running under Manjaro KDE. Following numerous guides & answers I have managed to get clipboard sharing to work between the host and client using the `spice` display server and `spice-...
I have Fedora 35 installed as a VM, with Qemu/KVM as the hypervisor and virt-manager as the graphical front-end, running under Manjaro KDE. Following numerous guides & answers I have managed to get clipboard sharing to work between the host and client using the spice display server and spice-vdagent on the client. However this only seems to work when the client logins to the X11 session. I have found [a Reddit post](https://www.reddit.com/r/swaywm/comments/pg0rqi/clipboard_sharing_using_spicevdagent_not_working/) which claims spice-vdagent only supports the X11 clipboard, which is uncorroborated but so far agrees with my testing. Here's the systemd journals when I login to X11/Wayland on the VM respectively:
> journalctl -b -u spice-vdagentd*
## timestamps & hostname removed

## X11
spice-vdagentd: opening vdagent virtio channel
spice-vdagentd: Set max clipboard: 104857600
spice-vdagentd: Set max clipboard: 104857600

## Wayland
spice-vdagentd: Error getting owner UID for pid 1063: No such process
spice-vdagentd: UID mismatch: UID=1000 PID=1063 suid=4294967295
So my question is: is it true that spice-vdagent does not yet support Wayland clipboard? If false, what could be going wrong? If true, are there currently any good workarounds (except for the obvious "don't use Wayland")?
cyqsimon (905 rep)
Apr 5, 2022, 02:26 PM • Last activity: Jul 10, 2025, 09:49 PM
0 votes
2 answers
2916 views
Cannot start KVM machine on arch after update
I'm having trouble with a VM I was using yesterday. After using, I closed the guest and updated my host machine (arch linux). Today I turned on the host and tried to turn on my guest and this message appeared: > Error starting domain: unsupported configuration: chardev 'spicevmc' > not supported wit...
I'm having trouble with a VM I was using yesterday. After using, I closed the guest and updated my host machine (arch linux). Today I turned on the host and tried to turn on my guest and this message appeared: > Error starting domain: unsupported configuration: chardev 'spicevmc' > not supported without spice graphics > > Traceback (most recent call last): > > File > "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in > cb_wrapper > callback(asyncjob, *args, **kwargs) > > File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb > callback(*args, **kwargs) > > File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line > 57, in newfn > ret = fn(self, *args, **kwargs) > > File "/usr/share/virt-manager/virtManager/object/domain.py", line 1384, in > startup > self._backend.create() > > File "/usr/lib/python3.10/site-packages/libvirt.py", line 1352, in create > raise libvirtError('virDomainCreate() failed') libvirt.libvirtError: unsupported configuration: chardev 'spicevmc' > not supported without spice graphics I'm using a dedicated nvidia card on a manjaro guest OS. **I'm not a linux expert.** Any idea what might be happening and how to fix this? Any other info you need let me know. **UPDATE #1:** I removed the usb spice redirectors from my VM: And now it works fine... I just can't have usb redirectors on the guest OS now... Anyone know why this is and how to fix it?
his dudeness (131 rep)
Jun 6, 2022, 01:32 PM • Last activity: May 22, 2025, 02:07 AM
0 votes
0 answers
474 views
copy/paste works with text but not with files
I'm using Qemu to have a Windows virtual machine (which is integrated to an active-directory domain). I want to copy/paste a file from my host (archlinux) to my guest (Windows 10 Business). For that, I use `spice`. Thus, I start qemu with the following command: ```shell qemu-system-x86_64 -enable-kv...
I'm using Qemu to have a Windows virtual machine (which is integrated to an active-directory domain). I want to copy/paste a file from my host (archlinux) to my guest (Windows 10 Business). For that, I use spice. Thus, I start qemu with the following command:
qemu-system-x86_64 -enable-kvm
  -cpu host
  -smp 4
  -drive if=pflash,format=raw,file=OVMF.fd
  -vga qxl
  -device virtio-serial-pci
  -spice port=5930,disable-ticketing=on
  -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0
  -chardev spicevmc,id=spicechannel0,name=vdagent
  -m 16G
  Windows.qcow2
(line breaks inserted for readability) Then, I use spicy to connect to it. I installed spice-guest-tools on the guest Windows virtual machine. The copy/paste works well for a text but not for a file. I use thunar as file manager on Linux. Do you know why? Also I don't want to use virt-manager.
sebastien dontneedtoknowthat (137 rep)
Nov 20, 2022, 09:19 AM • Last activity: Nov 20, 2024, 07:53 AM
1 votes
2 answers
2495 views
How to restore 4K resolution that disappeared after Spice Guest Tools install Qemu KVM
I am running a Arch Linux 6.0.9 as a host for a Windows 11 virtual machine. When I first installed the VM I had the option in Windows for 3840x2160 4k resolution with the default windows driver (I think it was windows basic display adapter) however after installing Spice guest tools and installing t...
I am running a Arch Linux 6.0.9 as a host for a Windows 11 virtual machine. When I first installed the VM I had the option in Windows for 3840x2160 4k resolution with the default windows driver (I think it was windows basic display adapter) however after installing Spice guest tools and installing the included drivers, the windows display resolution now maxes out at 2560x1600. My video setting on the VM configuration page says QXL and I have tried VGA and Virtio, but they just give me various lower resolutions and none have the previously available 3840x2160. How do I make 3840x2160 available again in the windows guest machine? I think it might have something to do with the Red Hat QXL controller display adapter but I do not know how to resolve the issue.
Orcam (103 rep)
Nov 24, 2022, 06:46 AM • Last activity: Oct 25, 2024, 08:06 PM
2 votes
1 answers
2159 views
How to align gpm mouse cursor with graphical mouse cursor in spice viewer (QEMU VM)?
I have a Linux console running in a virtual machine (QEMU/KVM). Inside the VM I use GPM in order to select and paste text with the mouse. However, when I enter the VM's spice `virt-viewer` window in my graphical desktop the graphical mouse cursor of the desktop is completely at a different position...
I have a Linux console running in a virtual machine (QEMU/KVM). Inside the VM I use GPM in order to select and paste text with the mouse. However, when I enter the VM's spice virt-viewer window in my graphical desktop the graphical mouse cursor of the desktop is completely at a different position than the GPM mouse cursor. That is annoying and it means that some areas of the VM's text window cannot be reached without entering and exiting the spice window several times. **How do I align/synchronise the mouse cursors of spice/desktop and GPM?** I cannot install an additional program in the VM because it is a server. It must work with GPM alone. Perhaps QEMU needs some config options?
Ned64 (9256 rep)
Sep 6, 2019, 04:45 PM • Last activity: Jun 3, 2024, 02:05 PM
2 votes
3 answers
13938 views
Make shared clipboard work for qemu
The shared clipboard doesn't work for me. How to fix it? Host (Debian buster) with: - standard system utilities - **ufw** (ufw enabled, deny incoming, allow out going, deny routed) - apparmor-profiles, apparmor-profiles-extra - stterm - xserver-xorg-core, xserver-xorg-input-libinput, xinit - xserver...
The shared clipboard doesn't work for me. How to fix it? Host (Debian buster) with: - standard system utilities - **ufw** (ufw enabled, deny incoming, allow out going, deny routed) - apparmor-profiles, apparmor-profiles-extra - stterm - xserver-xorg-core, xserver-xorg-input-libinput, xinit - xserver-xorg-video-intel - jwm - virt-manager - /var, /tmp, /var/lib/dpkg, /home are mounted with nodev, noexec, nosuid - xclip, x11-apps I add my vm user (non-root) to the libvirt group. Guest (Debian buster) with: - standard system utilities - **ufw** (ufw enabled, deny incoming, allow out going, deny routed) - apparmor-profiles, apparmor-profiles-extra - xserver-xorg-core, xserver-xorg-input-libinput, xinit - **xserver-xorg-video-qxl** - jwm - **spice-vdagent** - xclip, x11-apps With virt-manager of the host, I set the video to 'qxl' and the display spice to 'spice server'. That is the instruction in section "Enabling SPICE using virt-manager" at https://www.linux-kvm.org/page/SPICE The "Display Spice" hardware in the "Show virtual hardware details" have the following settings:
Spice Server
------------
type: Spice server
Listen type: Address
Address: Localhost only
Port: [x] Auto (Port:5900)
TLS port: [x] Auto
Since restarting the vm would magically make the "network" hardware disappear, I created another "network" hardware with the gui. ---------------------------- Somehow, within the guest the spice-vdagent doesn't automatically start. I set it to start automatically, following https://unix.stackexchange.com/questions/628158/qemu-kvm-spice-copy-paste-functionalities-work-on-the-windows-vm-but-not-on But shared clipboard still doesn't work. ---------------------------- In the gui, the "Channel spice" hardware says "State: disconnected". How to connect the channel?
Duh Huh (49 rep)
Mar 29, 2021, 01:02 AM • Last activity: May 6, 2024, 05:18 PM
1 votes
0 answers
232 views
Is it possible to hardware accelerate spice with an nvidia gpu?
It is possible to use virgl with an nvidia gpu: however using this approach, you cannot have gl enabled in spice, if you try to enable it in any way it just gives you this error: Error changing VM configuration: unsupported configuration: multiple OpenGL displays are not supported by QEMU So we have...
It is possible to use virgl with an nvidia gpu: however using this approach, you cannot have gl enabled in spice, if you try to enable it in any way it just gives you this error: Error changing VM configuration: unsupported configuration: multiple OpenGL displays are not supported by QEMU So we have an nvidia gpu accelerated opengl display that works for virgl and a laggy spice display that sorta makes the former a moot point. Is there any configuration arrangement where I can have the spice display opengl accelerated with the nvidia gpu powering virgl? Or even just redirect spice to use that egl-headless display?
Cestarian (2438 rep)
Apr 27, 2024, 09:03 PM
12 votes
5 answers
34618 views
How to create KVM guest with SPICE graphics but TLS disabled using virt-install?
I am using `virt-install` (see below) to create a guest. All seems fine up to the point where it complains about auto-allocation of the SPICE TLS port. Here's what I am running and the full output: # sudo virt-install --name vmname --ram 1024 --os-type=linux --os-variant=ubuntutrusty --disk path=/da...
I am using virt-install (see below) to create a guest. All seems fine up to the point where it complains about auto-allocation of the SPICE TLS port. Here's what I am running and the full output: # sudo virt-install --name vmname --ram 1024 --os-type=linux --os-variant=ubuntutrusty --disk path=/data/vm/vmname_sda.qcow2,bus=virtio,size=10,sparse=false --noautoconsole --console pty,target_type=virtio --accelerate --hvm --network=network:default --graphics spice,port=20001,listen=127.0.0.1 Starting install... Retrieving file MANIFEST... | 2.1 kB 00:00 ... Retrieving file MANIFEST... | 2.1 kB 00:00 ... Retrieving file linux... | 11 MB 00:00 ... Retrieving file initrd.gz... | 41 MB 00:00 ... ERROR unsupported configuration: Auto allocation of spice TLS port requested but spice TLS is disabled in qemu.conf Domain installation does not appear to have been successful. If it was, you can restart your domain by running: virsh --connect qemu:///system start vmname otherwise, please restart your installation. The error is: > ERROR unsupported configuration: Auto allocation of spice TLS port requested but spice TLS is disabled in qemu.conf and indeed in my /etc/libvirt/qemu.conf I have: spice_tls = 0 (and intentionally so). So how can I create a KVM guest using the SPICE protocol for graphics, **but with TLS disabled**? I doubt it is of relevance, but the reason I want to disable TLS is because I am tunneling the connection to SPICE via SSH already. No need for an extra layer of encryption. ---------- The host system is Ubuntu 14.04.1. Package versions are: * virtinst: 0.600.4-3ubuntu2 * qemu-kvm: 2.0.0+dfsg-2ubuntu1.2 (all up to date as far as apt-get is concerned)
0xC0000022L (16938 rep)
Aug 6, 2014, 05:35 PM • Last activity: Apr 23, 2024, 01:04 PM
1 votes
2 answers
2717 views
How to let Qemu autoselect a listening port for Spice?
I'm switching some VMs from VNC display type to SPICE. VNC display type offers a very handy `to=` parameter allowing QEMU to automatically use the first free port from a defined range: -display vnc=127.0.0.1:0,to=100 Here QEMU will use ports between 5900 and 6000 for each new VNC display server. Wha...
I'm switching some VMs from VNC display type to SPICE. VNC display type offers a very handy to= parameter allowing QEMU to automatically use the first free port from a defined range: -display vnc=127.0.0.1:0,to=100 Here QEMU will use ports between 5900 and 6000 for each new VNC display server. What is the cleanest way to achieve such functionality with SPICE display (by the way I'm not using libvirt)? Currently I'm on my way to script a test greping netstat output to find a yet unused port and pass it to: -spice addr=127.0.0.1,port=${unused_port} Without mentioning race conditions, I just find this method quite ugly compared to the VNC one. And since QEMU manpage does not seem very exhaustive (VNC to= parameter doesn't seem mentioned for instance), then I wonder if by any chance there is an equivalent parameter for SPICE?
WhiteWinterWolf (2961 rep)
Jul 8, 2015, 08:48 AM • Last activity: Mar 12, 2024, 11:22 PM
3 votes
0 answers
1963 views
When using Spice and remote-viewer with multiple virtual monitors, stuck on "Waiting for display 2" indefinately
Following some research, I learned that the proper method to setup multiple virtual monitors with virt-manager, libvirtd, and qemu is to use spice ([link][1], [link][2], [link][3]). At first, I added three total Video QXL instances, and then connected to Spice via remote-viewer. This did not work be...
Following some research, I learned that the proper method to setup multiple virtual monitors with virt-manager, libvirtd, and qemu is to use spice (link , link , link ). At first, I added three total Video QXL instances, and then connected to Spice via remote-viewer. This did not work because I saw a window such as this when opening a VM's second or third virtual display (the primary one works fine): Remote viewer showing second monitor with The extra monitors also were not shown the virtual machine. As such, I tried removing the extra Video QXL hardwares, and instead set the one that was there by default to have three heads:
This unfortunately produced the same error when opening the additional virtual displays, except not when I do so graphical artifacts appear in the primary display and it becomes unusable as a result. What did I do incorrectly here? How can I enable multiple displays with this VM software stack? Main spice XML:
Both the host and guest are Linux (Pop OS and Debian 10 respectively). I tried upping the video ram from 16MBs to 256MBs, which ends the graphical glitches, but it does not enable interaction with the primary monitor after the second is enabled nor does it allow the second to progress past the above screenshot. I also have spice-vdagent installed in the guest. How can I make this work?
john01dav (243 rep)
May 17, 2021, 04:52 PM • Last activity: Aug 8, 2023, 04:30 PM
9 votes
1 answers
17520 views
Redirect USB device in KVM while guest is running
I have two USB Redirector devices in my KVM, created using virt-manager: I can use these to redirect a USB device at runtime, in virt-manager by going to Virtual Machine > Redirect USB device, I can then pick which host devices to pass through the Spice channel: [![virt-manager choose usb][1]][1] Ho...
I have two USB Redirector devices in my KVM, created using virt-manager: I can use these to redirect a USB device at runtime, in virt-manager by going to Virtual Machine > Redirect USB device, I can then pick which host devices to pass through the Spice channel: virt-manager choose usb How do I do the same with virsh, or some other terminal tool? I would like to be able to switch it off and on, basically to move a device from one VM to another.
MarcinJ (281 rep)
Aug 26, 2022, 02:24 PM • Last activity: Aug 1, 2023, 03:53 AM
0 votes
1 answers
2748 views
Can not drag-drop or copy-paste files between guest and host
The [documentation][1] says: > Installing the Spice vdagent in your guest will let you copy and paste > between your guest and client OSes, to drag and drop files between the > 2 OSes, … In order for the agent to work, your virtual machine must > have a virtio serial device (and the corresponding gu...
The documentation says: > Installing the Spice vdagent in your guest will let you copy and paste > between your guest and client OSes, to drag and drop files between the > 2 OSes, … In order for the agent to work, your virtual machine must > have a virtio serial device (and the corresponding guest drivers) as > well as a Spice spicevmc channel. It also says: > Agent support allows better integration with the guest. For example, > it allows copy and paste between the guest and the host OSes, dynamic > resolution changes when the client window is resized/full-screened, > file transfers through drag and drop, … > > The agent is a daemon/service running in the guest OS so it must be > installed if it was not installed by default during the guest OS > installation. It also relies on a virtio-serial PCI device and a > dedicated spicevmc char device to achieve communication between the > guest and the host. These devices must be added to the virtual machine > for the agent to work in the guest. I have installed all the necessities in the guest. And then enabled the services. sudo apt install qemu-guest-agent spice-vdagent spice-webdavd sudo systemctl start spice-vdagent sudo systemctl enable spice-vdagent sudo systemctl start qemu-guest-agent sudo systemctl enable qemu-guest-agent sudo systemctl start spice-webdavd sudo systemctl enable spice-webdavd Started the vm with the following script. #!/bin/bash QEMU_AUDIO_DRV=spice qemu-system-x86_64 -accel kvm,thread=multi -cpu host -smp 2 -m 8192 \ -drive file=/media/ismail/SSDWorking/_QEMU/vm_mint.qcow2,format=qcow2,if=virtio \ -machine vmport=off \ -vga virtio -usb -device qemu-xhci -device usb-tablet \ -soundhw hda \ -spice port=5911,addr=127.0.0.1,disable-ticketing \ -device virtio-serial-pci \ -chardev spicevmc,id=spicechannel0,debug=0,name=vdagent \ -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \ -device virtserialport,chardev=charchannel1,id=channel1,name=org.spice-space.webdav.0 \ -chardev spiceport,name=org.spice-space.webdav.0,id=charchannel1 \ -chardev socket,path=/tmp/qga.sock,server=on,wait=off,id=qga0 \ -device virtio-serial \ -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 \ -daemonize remote-viewer --spice-shared-dir=/media/ismail/SSDWorking/_QEMU/VM_Share spice://127.0.0.1:5911 > /dev/null 2>&1 & Now dynamic resolution changes work. However, drag and drop and copy-paste files between guest and host does not work. Just to be clear, copy-paste text between guest and host works. Drag and drop text between guest and host does not work. In the case of files, neither copy-paste nor drag and drop work. What might be the reason?
Ahmad Ismail (2998 rep)
May 13, 2023, 11:05 AM • Last activity: May 14, 2023, 07:03 AM
1 votes
1 answers
2726 views
Spice support disabled in qemu
I'm pretty knew to virtualization and linux in general and I'm having issues getting spice to work with qemu. I'm trying to install a windows 10 machine using virt-manager on Arch, and the installation refuses to work. Whenever I try to install the machine, it spits out the following error: Unable t...
I'm pretty knew to virtualization and linux in general and I'm having issues getting spice to work with qemu. I'm trying to install a windows 10 machine using virt-manager on Arch, and the installation refuses to work. Whenever I try to install the machine, it spits out the following error: Unable to complete install: 'internal error: process exited while connecting to monitor: Failed to open module: libssl.so.3: cannot open shared object file: No such file or directory qemu-system-x86_64: -spice port=5900,addr=127.0.0.1,disable-ticketing=on,image-compression=off,seamless-migration=on: spice support is disabled' I *think* I have spice installed correctly, but I'm not really sure as the spice docs don't really make a lot of sense to me, and spice as a whole is also very confusing to me. I'm running Xero Linux on a Acer 5 (A515-45). Kindly let me know if you require anymore information and/or details. Cheers.
Literal Garbage (13 rep)
Nov 23, 2022, 09:19 PM • Last activity: Nov 30, 2022, 07:18 AM
2 votes
1 answers
1281 views
Part of virtual machine's screen is not visible when resolution changes with SPICE
A virtual machine with Windows 10 as the guest's OS is set up using KVM/QEMU. Without SPICE, it worked perfectly fine but for clipboard sharing, I followed [Arch Linux's Guide][1]. But then it's super annoying since everytime virt-viewer's window size changes, the guest's resolution becomes unexpect...
A virtual machine with Windows 10 as the guest's OS is set up using KVM/QEMU. Without SPICE, it worked perfectly fine but for clipboard sharing, I followed Arch Linux's Guide . But then it's super annoying since everytime virt-viewer's window size changes, the guest's resolution becomes unexpected and I cannot see all content on the screen. My qemu parameters:
#!/bin/bash
qemu-system-x86_64 -boot c -m 4.5G \
-drive file=win10.img,format=raw,index=0,media=disk,if=virtio,aio=native,cache=none \
-enable-kvm \
-machine q35 \
-device intel-iommu \
-cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time \
-smp 4 \
-net nic,model=virtio \
-net user,smb=/home/tek/data \
-soundhw hda \
-usb -device usb-tablet \
-vga qxl \
-device virtio-serial-pci \
-device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
-chardev spicevmc,id=spicechannel0,name=vdagent \
-spice unix,addr=/tmp/vm_spice.socket,disable-ticketing \
-display spice-app
Is there a way to disable SPICE's dynamic screen resolution since I don't find it useful but still retain the ability to share clipboard or fix this weird phenomenon? The lower right part of the screen is not visible (especially the clock), and my screen's native resolution is only 1920x1080 Screenshot
Daanturo (133 rep)
Nov 22, 2019, 11:58 AM • Last activity: Oct 19, 2022, 07:51 AM
0 votes
0 answers
111 views
Securely Forward Service on Private Network to Client on Another Private Network
I have two computers on private networks and a VPS, all running Linux. I would like to be able to make a secure tunnel between the two computers so that one can securely access services hosted by the other. I have tried looking at other solutions, but as far as I can tell they do not create a 'seaml...
I have two computers on private networks and a VPS, all running Linux. I would like to be able to make a secure tunnel between the two computers so that one can securely access services hosted by the other. I have tried looking at other solutions, but as far as I can tell they do not create a 'seamless' and secure tunnel between the two computers because one has to ssh into a VPS then ssh into the second computer from there after reverse forwarding it to the VPS, or they only work for SSH and don't allow forwarding other applications. This doesn't allow me to access the interface directly from the first computer as far as I know. Let us call these the Remote Computer, VPS, and Local Computer. * Remote Computer: Hosts Services (Spice Server) * VPS: Forwards Services * Local Computer: Accesses Services
________________       _____       _________________
|                |     |     |     |                 |
| Local Computer |  | VPS |  | Remote Computer |
|________________|     |_____|     |_________________|

( = Secure SSH Tunnel)
I tried using SSH, but could not figure out how to do it securely. One of the services I am trying to forward is a Spice server and I did so by setting GatewayPorts to yes in /etc/ssh/sshd_config on the VPS and running the command ssh -R 55667:localhost:5900 user@VPS_IP on the Remote Computer, which allowed me to access the spice server by running remote-viewer spice://VPS_IP:55667 on the Local Computer. That, of course, wasn't be very secure though. A second solution I am considering is to use the following commands to try to make a secure connection:
# Remote Computer
ssh -R 55667:localhost:5900 user@VPS_IP

# Local Computer
ssh -L 55667:localhost:55667 user@VPS_IP
remote-viewer spice://localhost:55667
For this GatewayPorts was enabled in /etc/ssh/sshd_config. I should also note that the spice server allows for one to set a password, though I'm pretty sure it doesn't encrypt anything and I am unsure about it's ability to protect the VM against attackers. This solution works, or at least I was able to access the spice server using the last command, but it still leaves the server accessible for people to do things like attempt to brute force the password for the spice server. Will the last example create a secure connection between the Local Computer and remote Computer? If not, is there a simple way to make a secure tunnel using something like SSH between the two computers so that I could, for example, run remote-viewer spice://localhost:55667 on the Local Computer, to access the spice server on the Remote Computer? Thank you in advance, and please let me know if there is any other information about the question I should provide!
Graham H (1 rep)
Aug 26, 2022, 09:41 PM • Last activity: Aug 26, 2022, 09:42 PM
1 votes
2 answers
5796 views
Spice for graphic, pulseaudio for sound
When we use Spice in a virtual machine under KVM/qemu/libvirt, the QEMU_AUDIO_DRV is set to spice by default. My host (debian-Stretch) use a good sound card (Xonar DX) and a better sound driver (pulseaudio,alsa). How to use in a virtual machine spice for the graphic aspect and pulseaudio or alsa for...
When we use Spice in a virtual machine under KVM/qemu/libvirt, the QEMU_AUDIO_DRV is set to spice by default. My host (debian-Stretch) use a good sound card (Xonar DX) and a better sound driver (pulseaudio,alsa). How to use in a virtual machine spice for the graphic aspect and pulseaudio or alsa for the sound aspect (whatever the guest OS) ? **Note 1**: in the domain.xml, I added: Now, in domain.log, I see: QEMU_AUDIO_DRV=pa QEMU_PA_SERVER=/run/user/1000/pulse/native Well but I don't know if my guest uses pulseaudio or not because domain.xml has the following section: **Note 2**: other try: No sound.
Bertaud (255 rep)
Jan 21, 2018, 10:58 PM • Last activity: Sep 1, 2021, 12:33 PM
0 votes
1 answers
3266 views
QEMU/KVM SPICE - copy & paste functionalities work on the Windows VM, but not on the Debian VM
**Client:** I installed a package `spice-client-gtk` on my Debian workstation which conects to the remote server i.e. hypervisor running virtual machines on QEMU-KVM. `spice-client-gtk` is not installed on the hypervisor itself. **Virtual machines:** In `virt-manager` I double clicked every single v...
**Client:** I installed a package spice-client-gtk on my Debian workstation which conects to the remote server i.e. hypervisor running virtual machines on QEMU-KVM. spice-client-gtk is not installed on the hypervisor itself. **Virtual machines:** In virt-manager I double clicked every single virtual machine and in main menu navigated to ViewDetails. Then I selected a property called Display [Spice|VNC] and set section Type to Spice server. I also selected another property on the left called Video [QXL|Virtio|VGA] and set section Model to QXL. Then I clicked Add Hardware, selected a property Channel and set section Name to com.redhat.spice.0 and section Device Type to Spice agent (spicevmc). On Windows virtual machines I installed [Spice guest tools](https://www.spice-space.org/download.html#windows-binaries) and after I restarted the virtual machine I was able to copy & paste between my workstation and Windows virtual machines. On Debian virtual machines I installed a package spice-vdagent and restarted, but copy & paste does not work. I executed systemctl to check the services and found out that only spice-vdagentd.socket is the only service that runs. Then I checked the status of all the services: ┌───┐ │ # │ ziga > debian--vm > ~ └─┬─┘ └─> systemctl status spice-vdagentd.service ● spice-vdagentd.service - Agent daemon for Spice guests Loaded: loaded (/lib/systemd/system/spice-vdagentd.service; indirect; vendor preset: enabled) Active: inactive (dead) ┌───┐ │ # │ ziga > debian--vm > ~ └─┬─┘ └─> systemctl status spice-vdagent.service ● spice-vdagentd.service - Agent daemon for Spice guests Loaded: loaded (/lib/systemd/system/spice-vdagentd.service; indirect; vendor preset: enabled) Active: inactive (dead) ┌───┐ │ # │ ziga > debian--vm > ~ └─┬─┘ └─> systemctl status spice-vdagentd.socket ● spice-vdagentd.socket - Activation socket for spice guest agent daemon Loaded: loaded (/lib/systemd/system/spice-vdagentd.socket; enabled; vendor preset: enabled) Active: active (listening) since Fri 2021-01-08 08:57:50 CET; 4min 59s ago Listen: /var/run/spice-vdagentd/spice-vdagent-sock (Stream) CGroup: /system.slice/spice-vdagentd.socket Jan 08 08:57:50 localhost systemd: Listening on Activation socket for spice guest agent daemon. ┌───┐ │ # │ ziga > debian--vm > ~ └─┬─┘ └─> ls /lib/systemd/system/ | grep spice -rw-r--r-- 1 root root 335 Oct 3 2018 spice-vdagentd.service -rw-r--r-- 1 root root 280 Oct 3 2018 spice-vdagentd.socket lrwxrwxrwx 1 root root 22 Oct 3 2018 spice-vdagent.service -> spice-vdagentd.service Note that service spice-vdagent.service is a symbolic link to the spice-vdagentd.service. Now I checked definition files for systemd services: ┌───┐ │ # │ ziga > debian--vm > ~ └─┬─┘ └─> cat /lib/systemd/system/spice-vdagentd.service [Unit] Description=Agent daemon for Spice guests Requires=spice-vdagentd.socket [Service] Type=forking EnvironmentFile=-/etc/default/spice-vdagentd ExecStart=/usr/sbin/spice-vdagentd $SPICE_VDAGENTD_EXTRA_ARGS PIDFile=/var/run/spice-vdagentd/spice-vdagentd.pid PrivateTmp=true Restart=on-failure [Install] Also=spice-vdagentd.socket ┌───┐ │ # │ ziga > debian--vm > ~ └─┬─┘ └─> cat /lib/systemd/system/spice-vdagentd.socket [Unit] Description=Activation socket for spice guest agent daemon # only start the socket if the virtio port device exists Requisite=dev-virtio\x2dports-com.redhat.spice.0.device [Socket] ListenStream=/var/run/spice-vdagentd/spice-vdagent-sock [Install] WantedBy=sockets.target > **Note:** > > Configuration parameter EnvironmentFile has a minus (-) > in front of the root folder: > > EnvironmentFile=-/etc/default/spice-vdagentd > > This is not a bug as @Zaroth pointed out in his answer. I also decided to create a /etc/default/spice-vdagentd which does not exist by default. Then inside I added one line that explicitly sets the Spice channel like suggested in the [man page](https://manpages.debian.org/buster/spice-vdagent/spice-vdagentd.1.en.html) : ┌───┐ │ # │ ziga > debian--vm > ~ └─┬─┘ └─> touch /etc/default/spice-vdagentd ┌───┐ │ # │ ziga > debian--vm > ~ └─┬─┘ └─> echo "SPICE_VDAGENTD_EXTRA_ARGS = -s "/dev/virtio-ports/com.redhat.spice.0" Note the Spice chanell /dev/virtio-ports/com.redhat.spice.0 already exists on Debian virtual machine because I previously set it in the virt-manager. I tried to restart the Debian virtual machine but still... copy & paste does not work. **** **ADD:** @Zaroth suggested to manually start and enable the service spice-vdagentd.service. I did it and then checked the statuses of both services: ┌───┐ │ # │ ziga > debian--vm > ~ └─┬─┘ └─> systemctl status spice-vdagentd.socket ● spice-vdagentd.socket - Activation socket for spice guest agent daemon Loaded: loaded (/lib/systemd/system/spice-vdagentd.socket; enabled; vendor preset: enabled) Active: active (running) since Fri 2021-01-08 10:08:06 CET; 2min 28s ago Listen: /var/run/spice-vdagentd/spice-vdagent-sock (Stream) Tasks: 0 (limit: 1149) Memory: 0B CGroup: /system.slice/spice-vdagentd.socket Jan 08 10:08:06 localhost systemd: Listening on Activation socket for spice guest agent daemon. ┌───┐ │ # │ ziga > debian--vm > ~ └─┬─┘ └─> sudo systemctl status spice-vdagentd.service ● spice-vdagentd.service - Agent daemon for Spice guests Loaded: loaded (/lib/systemd/system/spice-vdagentd.service; indirect; vendor preset: enabled) Active: active (running) since Fri 2021-01-08 10:09:02 CET; 1min 38s ago Process: 1263 ExecStart=/usr/sbin/spice-vdagentd $SPICE_VDAGENTD_EXTRA_ARGS (code=exited, status=0/SUCCESS) Main PID: 1264 (spice-vdagentd) Tasks: 1 (limit: 1149) Memory: 520.0K CGroup: /system.slice/spice-vdagentd.service └─1264 /usr/sbin/spice-vdagentd -s /dev/virtio-ports/com.redhat.spice.0 Jan 08 10:09:02 localhost systemd: Starting Agent daemon for Spice guests... Jan 08 10:09:02 localhost systemd: spice-vdagentd.service: Can't open PID file /run/spice-vdagentd/spice-vdagentd.pid Jan 08 10:09:02 localhost systemd: Started Agent daemon for Spice guests. Status for service spice-vdagentd.service reports that it can't open a PID file but I double checked and this file is sucessfully created every time I manually start the spice-vdagentd.service. Here it is: ┌───┐ │ # │ ziga > debian--vm > ~ └─┬─┘ └─> ls -l /run/spice-vdagentd/spice-vdagentd.pid -rw-r--r-- 1 root root 5 Jan 8 10:19 /run/spice-vdagentd/spice-vdagentd.pid It is weird as everything looks as it should but spice-vdagentd.service isn't started even if enabled. How to fix this?
71GA (1296 rep)
Jan 8, 2021, 08:36 AM • Last activity: Jan 11, 2021, 09:23 AM
1 votes
1 answers
955 views
USB connects then disconnects on QEMU / windows 10 guest
Essentially the usb device connects for about 2-3 seconds, then disconnects for about 2-3 seconds, then reconnects... This also happens if I pass it through directly. If I install the spice-tools the mouse disappears, but even then the USB doesn't work. The error is the same but not exactly the same...
Essentially the usb device connects for about 2-3 seconds, then disconnects for about 2-3 seconds, then reconnects... This also happens if I pass it through directly. If I install the spice-tools the mouse disappears, but even then the USB doesn't work. The error is the same but not exactly the same behavior as [this](https://gitlab.freedesktop.org/spice/usbredir/-/issues/5) ; i.e.
Notably, I'm using an nvidia 1060 and applied [this](https://forum.level1techs.com/t/nvidia-gpu-passthrough-with-virtual-machine-manager-how-to-fix-error-43/162250) because the normal method doesn't work. I am currently using a spice display in conjunction with direct 1060 output as that way I can more easily share my keyboard / mouse. When using an AMD card this wasn't an issue. Also, for some reason at random times the sound gets super staticky, and this seems to also sometimes be triggered by plugging in a usb. Notably, this stops happening if I use an LVN screen instead of spice. Kernel: 5.9.16-1-MANJARO libvirtd: 6.5.0 QEMU emulator: 5.2.0 Alternatively, is there a way to pass through USBs using the LVN screen?
Alita (111 rep)
Dec 31, 2020, 08:30 AM • Last activity: Dec 31, 2020, 11:11 AM
3 votes
0 answers
2910 views
virt-manager, qemu-kvm, spice & vdagent: auto resizing and file sharing not working
Host: Ubuntu 18.04 Guest: Fedora 33 virt-manager 1.5.1 I built the guest using virt-manager. The guest works: internet access works, youtube in browser works, sound works, clipboard sharing between guest and host works. Problem summary: ---------------- However auto resizing the display does not wor...
Host: Ubuntu 18.04 Guest: Fedora 33 virt-manager 1.5.1 I built the guest using virt-manager. The guest works: internet access works, youtube in browser works, sound works, clipboard sharing between guest and host works. Problem summary: ---------------- However auto resizing the display does not work. And host file sharing does not work. I can't find any relevant error message in any log file. **How do I find out what I am doing wrong and fix it?** Detail: ------- Virt-manager settings for my Fedora image include QXL, virtio and spice channels. The virt-manager launched spice window allows me (View menu) to select auto-resizing, that's ticked. I used virsh to edit the vgamem and give it 64MB rather than 16MB: Qemu command line generated by virt-manager qemu-system-x86_64 -enable-kvm -name guest=Fedora,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-9-Fedora/master-key.aes -machine pc-i440fx-bionic,accel=kvm,usb=off,vmport=off,dump-guest-core=off -cpu Skylake-Client-IBRS -m > -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid > -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-9-Fedora/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=/data/Fedora.qcow2,format=qcow2,if=none,id=drive-ide0-0-0 -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive if=none,id=drive-ide0-0-1,readonly=on -device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 -fsdev local,security_model=passthrough,id=fsdev-fs0,path=/data -device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=/data,bus=pci.0,addr=0x8 -netdev tap,fd=28,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=>,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=64,max_outputs=1,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=1 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 -msg timestamp=on On the guest, fgrep -R vdagent /var/log turns up a few lines but none that imply an error or problem to me. On the guest, fgrep -R /data /var/log does not turn up anything useful. /data being my share on the host and the intended mount point on the guest. I did mkdir /data; chmod 777 /data; reboot to check, same problem before and after. On the guest, the service is running: systemctl status spice-vdagentd ● spice-vdagentd.service - Agent daemon for Spice guests Loaded: loaded (/usr/lib/systemd/system/spice-vdagentd.service; indirect; vendor preset: enabled) Active: active (running) since Thu 2020-12-17 17:39:14 GMT; 5h 39min ago TriggeredBy: ● spice-vdagentd.socket Process: 1383 ExecStart=/usr/sbin/spice-vdagentd $SPICE_VDAGENTD_EXTRA_ARGS (code=exited, status=0/SUCCESS) Main PID: 1385 (spice-vdagentd) Tasks: 3 (limit: 19158) Memory: 4.2M CPU: 407ms CGroup: /system.slice/spice-vdagentd.service └─1385 /usr/sbin/spice-vdagentd Dec 17 17:39:14 localhost.localdomain systemd: Starting Agent daemon for Spice guests... Dec 17 17:39:14 localhost.localdomain systemd: spice-vdagentd.service: Can't open PID file /run/spice-vdagentd/spice-vdagentd.pid (yet?) after start: Oper> Dec 17 17:39:14 localhost.localdomain systemd: Started Agent daemon for Spice guests. Dec 17 17:39:14 localhost.localdomain spice-vdagentd: opening vdagent virtio channel Dec 17 17:39:14 localhost.localdomain spice-vdagentd: Set max clipboard: 104857600 Dec 17 17:39:14 localhost.localdomain spice-vdagentd: Set max clipboard: 104857600 Dec 17 22:57:01 localhost.localdomain spice-vdagentd: closed vdagent virtio channel Dec 17 22:57:04 localhost.localdomain spice-vdagentd: opening vdagent virtio channel Dec 17 22:57:04 localhost.localdomain spice-vdagentd: Set max clipboard: 104857600 Dec 17 22:57:04 localhost.localdomain spice-vdagentd: Set max clipboard: 104857600 The libvirt log on the host shows nothing special either: 2020-12-17 17:32:24.311+0000: starting up libvirt version: 4.0.0, package: 1ubuntu8.17 (Marc Deslauriers Wed, 06 May 2020 14:18:23 -0400), qemu version: 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.34), hostname: asm4 LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin QEMU_AUDIO_DRV=spice /usr/bin/kvm-spice -name guest=Fedora,> 2020-12-17T17:32:24.355739Z qemu-system-x86_64: -chardev pty,id=charserial0: char device redirected to /dev/pts/20 (label charserial0) main_channel_link: add main channel client red_qxl_set_cursor_peer: inputs_connect: inputs channel client create main_channel_handle_message: agent start main_channel_handle_message: agent start main_channel_handle_message: agent start main_channel_handle_message: agent start main_channel_handle_message: agent start main_channel_handle_message: agent start
asoundmove (2515 rep)
Dec 18, 2020, 12:11 AM • Last activity: Dec 24, 2020, 11:45 PM
1 votes
1 answers
2958 views
Disable sound when using Spice with KVM/libvirt
I see a lot of questions across SE about getting sound to work with KVM guests, whether using Spice or Pulseaudio. However, I would like the opposite. I would like **no sound whatsoever** to be passed from guest to host, using libvirt with virt-manager. Whenever I log in to a VM's graphical lockscre...
I see a lot of questions across SE about getting sound to work with KVM guests, whether using Spice or Pulseaudio. However, I would like the opposite. I would like **no sound whatsoever** to be passed from guest to host, using libvirt with virt-manager. Whenever I log in to a VM's graphical lockscreen or connect to an already-logged-in VM (using the built in Spice viewer or Remmina), the sample rate for my USB audio interface changes, and all sounds from the host increase in pitch until I open the host's audio menu or the Pulseaudio volume control (pavucontrol). Of course, I have removed the ICH9 sound device from the VM's configuration, and do not have any USB passthrough or forwarding configured. I have also checked Pulseaudio's configuration on the host, and I do not see the TCP module enabled. I have tried disabling Pulseaudio completely in the guest, and confirmed that it is not running. My host is running Fedora 32 with the sound provided by Pulseaudio in a near-default configuration.
multithr3at3d (542 rep)
Jan 30, 2020, 03:08 AM • Last activity: Sep 17, 2020, 11:21 PM
Showing page 1 of 20 total questions