Add clipboard support to the VNC console in the GUI

Nov 24, 2017
3
2
43
Hello,

In "Changelog Overview" of Proxmox VE 8.1 (https://pve.proxmox.com/wiki/Roadmap#Proxmox_VE_8.1) under "Virtual machines (KVM/QEMU)" there is a new feature called
  • Add clipboard support to the VNC console in the GUI. For now the feature cannot be enabled in the GUI and has to be manually enabled via API or CLI. After installing the SPICE guest tools, text can be copied from/to the guest clipboard using the noVNC clipboard button.

I installed the SPICE guest tools on a Debian 11 VM but can't figure out how to make it work. I couldn't find any commands on how to manually enable it via API or CLI.

Any help will highly be appreciate
 
Thanks for the info! Tried everything but still doesn't work or I don't know how to use it...

Steps done (Proxmox VE 8.1.3, VM ID 2230 - Debian 11):

- On VM (https://medium.com/@truthisouthere_...s-on-a-debian-based-system-in-vm-2bc66fc2d95b)

sudo apt install spice-vdagent

sudo systemctl start spice-vdagent

systemctl enable spice-vdagent

sudo systemctl status spice-vdagent

- ON Proxmox node where VM resides

qm set 2230 -vga std,clipboard=vnc

Now the VNC clipboard function (e.g. in the noVNC console panel) appears but still don't know how to use it
 

Attachments

  • Screenshot 2023-12-10 at 10.37.54.png
    Screenshot 2023-12-10 at 10.37.54.png
    128.1 KB · Views: 343
  • Like
Reactions: petru
For me it works this way:

To copy from external into that VM: copy something in your "real" system. Open the "Clipboard" as seen in your screenshot. Insert the content there. Leave it open, just to watch it. Go to the destination application (gedit for test in my case) in the VM. Insert the content there.

To copy from within the VM: select some text in (for example) gedit in the VM. That text is displayed immediately in the Clipboard from your screenshot. Select that text in this clipboard and copy it. Go to your destination application and insert it.

Have fun :)
 
Thank you very much for the detailed explanation. I think my expectation on how it should work is wrong.

What I would like to use it for is having the possibility of pasting long commands in the VM console of a Debian system without Desktop environment, in case I can't connect with ssh to that Debian system.

In short, pasting to a command prompt in a Linux VM in the console window.
 
  • Like
Reactions: wolframio
In short, pasting to a command prompt in a Linux VM in the console window.
Maybe there are tools for this. I have no idea though.

My personal workflow for using terminal sessions / bash is to have a multitude parallel ssh sessions (concentrated and made persistent with "tmux") in one single window with a terminal - without this incarnation of the copy-n-paste problem :)

There's always a way...
 
For me it works this way:

To copy from external into that VM: copy something in your "real" system. Open the "Clipboard" as seen in your screenshot. Insert the content there. Leave it open, just to watch it. Go to the destination application (gedit for test in my case) in the VM. Insert the content there.

To copy from within the VM: select some text in (for example) gedit in the VM. That text is displayed immediately in the Clipboard from your screenshot. Select that text in this clipboard and copy it. Go to your destination application and insert it.

Have fun :)
It appears that I am missing something. It doesnt work for me. I am using Debian 12.5. Any additional thoughts?
 

Attachments

  • 1717680177855.png
    1717680177855.png
    30.4 KB · Views: 29
Are you using KDE with X11 or with Wayland?
 
Thank you very much for the detailed explanation. I think my expectation on how it should work is wrong.

What I would like to use it for is having the possibility of pasting long commands in the VM console of a Debian system without Desktop environment, in case I can't connect with ssh to that Debian system.

In short, pasting to a command prompt in a Linux VM in the console window.
did you find a way to do this? i also need to copy/paste where theres no X or Desktop, only terminal CLI.

Anyone help?
 
did you find a way to do this? i also need to copy/paste where theres no X or Desktop, only terminal CLI.

Anyone help?
Since novnc cannot and never will work with bidirectional clipboard, I normally use GPM or screen/tmux to copy & paste text from inside of the virtual display device.
 
fyi here is a related thread showing how I'm using the vnc clipboard sharing in my vms. I couldn't get it working with desktop-less VMs though.
 
fyi here is a related thread showing how I'm using the vnc clipboard sharing in my vms. I couldn't get it working with desktop-less VMs though.
Yes, the SPICE way with guest tools ... this is the only option, anything else is at most "paste-able", yet copying from the VM to the host cannot work because a display is just a display. The other way you can send keystrokes to the VM via the qemu monitor, which is also implemented in various ways (e.g. hyper-v does this also).
 
If you require copy-pasting without a UI and don't want to use SSH/etc., you can also configure a serial port, use that as the display and then use xterm.js instead of noVNC to access the VM.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!