How make Copy/Paste on VNC kvm in proxmox

helicrenz

New Member
May 29, 2021
21
1
1
32
Hello proxmox guys!

Anyone manage to figure out how can we make copy/paste to work on vnc connection in kvm?

Any thought or suggestion will highly be appreciate.
 
  • Like
Reactions: nocturno
hi,

that cannot work so easily since the vnc server is done by qemu which does not know anything about the os (and clipboard) inside
if you need that functionality, i'd try spice or a screen sharing tool inside the vm.
 
Just to follow.. what that tampermonkey .. this is a plugin that copy all you type on the keyboard ? Or when you copy txt, this plugin get a read from the system os clipboard and then can write back as a paste to the online prox console ..?
 
Tampermonkey is a generic plugin for web browsers that allows you to do different things on websites.

The plugin is installed in Tampermonkey, and allows you to copy some text to your clipboard outside of Proxmox, then right click inside a Proxmox VM (likely a *nix based terminal), which will then paste the text on your clipboard in.

Since the script emulates typing on the keyboard, we've found there are slight differences with different keyboard layouts. Change the values in the `needs_shift` variable depending on your keyboard layout if a particular character isn't pasting correctly for you.

It's a very simple Javascript plugin, so if you have a problem, it's very easy to change.
 
@amunchet does it also allow copy/paste from/in a terminal?
Just paste - I didn't really need copying for my use case. I just didn't want to type in specifically passwords or sudos every time.

Pretty much what I said in the earlier post: you install tampermonkey (which is a plugin for your browser), install the script, (possibly modify it if you have a non-standard keyboard layout), copy some text (with Ctrl + C), open up Proxmox console, then right click to paste the text into the console.

Note: if you use LXC containers, you can copy and paste from that terminal without needing this plugin. That might be a better solution for you.
 
hi,

that cannot work so easily since the vnc server is done by qemu which does not know anything about the os (and clipboard) inside
if you need that functionality, i'd try spice or a screen sharing tool inside the vm.

So Spice seems to allow copy/paste which is great.

Do you know any Spice client for iOS (iPad)?
 
I think there's a bit of a misunderstanding here. SPICE is the means of communication with the VMs (kind of like a keyboard-video-mouse interface with software) - that's way more involved and complicated than what I'm doing. My Tampermonkey script is just forcing the browser to act as though it's typing in characters when you "paste" something - it's using Proxmox's built-in web console to pass the text along.

A SPICE client for the iPad would be a separate app - I would imagine the app creators would allow Copying/Pasting. The Tampermonkey script above is only for use with web browsers and the built-in proxmox web interface - you can access those through something like Chrome on the iPad (and it seems like you can install Proxmox as well), but it would be through the web browser and not a dedicated app like I think you're looking for.
 
  • Like
Reactions: chudak
hi,

that cannot work so easily since the vnc server is done by qemu which does not know anything about the os (and clipboard) inside
if you need that functionality, i'd try spice or a screen sharing tool inside the vm.
Vultr has this on their web console. No clue what they did to implement.
1686433134858.png
 
This very much annoyed me, so I made a Tampermonkey user script to solve the problem:

https://gist.github.com/amunchet/4cfaf0274f3d238946f9f8f94fa9ee02

(leave a star if this helps or a comment if something doesn't work for you :) )
Old thread, but wanted to give credit where credit is due. You have saved me a ton of stress. I found this because I decided to do the same thing, but you took the hit and did it for us! Works great. Thank you. (also, I found your website through the git that hosts the copy/paste code, nice work!)
 
I know this is an old post, but I think people are still looking for a solution to this problem, so here comes my solution.

I just installed NoMashine which is a free Remote Desktop.
Support for Windows, Mac Os, Linux
And works super well on local network.
With Zerotier installed, I have worldWide access.
 
We have 3 console plugins novnc, spice, xterm.ks - does any of them supports copy/paste ?
 

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!