noVNC: copy paste not works

I am working with Proxmox 6.0-4 and trying to use copy paste into Windows 2019 server virtual machine, without success (noVNC under Firefox and Chrome).

writing powershell lines like
"Install-WindowsFeature Server-Media-Foundation, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, RSAT-Clustering-Mgmt, RSAT-Clustering-PowerShell, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation, RSAT-ADDS" (from https://docs.microsoft.com/en-us/Exchange/plan-and-deploy/prerequisites?view=exchserver-2019)
is, well... boring and error prone... Any updates on this feature?
 
A "Send clipboard text" button next to the Send Tab / Escape / Ctrl-Alt-Del buttons would be a very valuable enhancement
 
for containers/host there is clipboard support, for vms support for that is relatively new and needs additional guest hardware and options exposed...

edit: also it needs the spice agent installed in the vm
 
it needs the spice agent installed in the vm
Does that really need to be the case?
  • When installing and maintaining a VM I often need to type command lines into the VM console. This procedure would be faster and less error prone with paste text from clipboard support.
  • Some of the VMs are images from other suppliers and while installing code in their image is possible, it is not at all desirable.
  • A recent reply on noVNC github suggests it should be possible in Proxmox and the code describes a Clipboard button in several places
For reference I suspect this is the relevant Proxmox bugzilla entry https://bugzilla.proxmox.com/show_bug.cgi?id=1406 and and earlier noVNC github discussion

Non text characters handling requirement
The built in function should support minimal functionality ie only the basic 7 bit ascii character set text send. If an application needs more elaborate functionality (emojii, graphics, other data types / structures and other MIME types) then requiring a guest handler is reasonable. In contrast exclude all functionality when there is no guest agent is a poor compromise and massive feature creep from the original bugzilla OP in my opinion.

74,000 view suggests to me this issue is a significant limitation in current approach taken by Proxmox.
 
Last edited:
Does that really need to be the case?

novnc has clipboard support as this is a rfb (vnc) extension protocol. qemu also accepts that and receives the clipboard from vnc, but to actually get the clipboard inside the guest, the spice-agent must be installed
see https://www.kraxel.org/blog/2021/05/qemu-cut-paste/

Non text characters handling requirement
The built in function should support minimal functionality ie only the basic 7 bit ascii character set text send. If an application needs more elaborate functionality (emojii, graphics, other data types / structures and other MIME types) then requiring a guest handler is reasonable. In contrast exclude all functionality when there is no guest agent is a poor compromise and massive feature creep from the original bugzilla OP in my opinion.
no also ascii only is impossible without a guest agent, as qemu then can only send keystrokes, and different keyboard layouts may not even have ascii equivalents...

edit: we'll probably implement this feature with the new qemu options, but no promises as to when that'll happen
 
no also ascii only is impossible without a guest agent
You confuse me. I also find the threads on this subject confusing as two completely different functions are mixed together.

noVNC in Proxmox console already has buttons for
  • Send tab
  • Send escape
  • Send ctrl-alt-delete
I thought these worked in a VM without a guest agent. Essentially functioning as a soft-keyboard. Which could be extended by analogy to include the option mimic keyboard entry to
  • Sent clipboard text (7 bit ascii)
I do not want communication between the clipboard of my browser used to access Proxmox and my VM's clipboard; because that will fail for all my VMs that do not support a clipboard function.

My use case is the same as the OP of the above linked threads.
  • Entering long passwords
  • Entering command lines into a VM console (typically root commands) to reliably perform configuration, and fault recovery.
  • For example: initial root configuration of a pfsense or 3cx Linux install (note these comercial images do not contain a VM agent for console access). Similarly initial configuration of a minimal Linux server to load or repair the core packages. Note none of these have a GUI or clipboard, and even it they did, having something which worked even without a functioning guest agent would be very valuable.
In contrast a VM running a GUI equipped multimedia OS clearly needs a higher level data interchange for which a structured clipboard would be very valuable. But that is a completely different application.

Proxmox administration, please reconsider the need for low level text support. I appreciate adding it now is a difficult decision to make as it has been rejected for many years, but I think there is a good use case for two independent capabilities in Proxmox.
 
Last edited:
I thought these worked in a VM without a guest agent. Essentially functioning as a soft-keyboard. Which could be extended by analogy to include the option mimic keyboard entry to
  • Sent clipboard text (7 bit ascii)
no, i'll try to explain:

qemu is connected to the vm only via hardware, so to enter text, you have to send keystrokes via the virtual hardware to the vm
for tab/ctrl/etc. this works *most of the time* since those are generally the same across keyboards. as soon as you want to send text, it get's complicated
e.g. inserting the text 'z' would produce different result on an english and a german keyboard (those are switched; QWERTY and QWERTY)
if you have e.g. a russian keyboard those are missing at all...

the reason why it works for 'normal' vnc use though is because the browser can detect the keystroke you send it and forward it to the vm
(still a bit of mapping involved but it works for most things)

if you just have text copied into a textfield, this keystroke information is not there, and there is no general mapping from text -> keystrokes

so, even for ascii input it's generally impossible to reliably do that without some agent in the guest where you can transmit text from the browser
to the guest clibpoard (it may work for some scenarios, but fail for most others then)
 
... to enter text, you have to send keystrokes ... 'z' would produce different result on an english and a german keyboard ... it works for 'normal' vnc use though is because the browser can detect the keystroke you send it and forward it to the vm ...

So keyboards don't use ascii coding, the key mapping is keyboard dependent. What a weird choice of standard.

if you just have text copied into a textfield, this keystroke information is not there, and there is no general mapping from text -> keystrokes

So noVNC would need a "Keyboard" setting to do the ascii to key code mapping reliably.

Some browsers expose keyboard layout information but unfortunately not all.

Interestingly the Windows Server, Hyper-V Manager, Virtual Machine Connection, does provide a Menu "Clipboard" -> "Type Clipboad text". But give the above I guess they are using the operating system keyboard layout information to do the key mapping.

So in summary to have a:
  • Send/Type clipboard text -> Proxmox would need a keyboard setting
  • General clipboard copy / paste -> each VM needs a guest agent
 
Last edited:
So keyboards don't use ascii coding, the key mapping is keyboard dependent. What a weird choice of standard.
it uses scancodes:
https://en.wikipedia.org/wiki/Scancode

So noVNC would need a "Keyboard" setting to do the ascii to key code mapping reliably.

Some browsers expose keyboard layout information but unfortunately not all.

Interestingly the Windows Server, Hyper-V Manager, Virtual Machine Connection, does provide a Menu "Clipboard" -> "Type Clipboad text". But give the above I guess they are using the operating system keyboard layout information to do the key mapping.

So in summary to have a:
  • Send/Type clipboard text -> Proxmox would need a keyboard setting
  • General clipboard copy / paste -> each VM needs a guest agent
actually that would be needed in qemu, which already exists, you can set a 'keyboard layout' in qemu
but this is 1. deprecated, 2. complicated in code, 3. incomplete (there are many different keyboard layouts, and qemu does not implement them all)

in conclusion that will probably never reliably work without cooperation from the guest (in any solution, e.g. for spice/remote desktop/etc. it only ever works because the guest/host can cooperate)
 
Use this simple script for pasting long passwords:

JavaScript:
(async () => {
  const text = prompt("Enter text to type:");
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
  const input = document.getElementById("noVNC_keyboardinput");
  const keydown = (key) => input.dispatchEvent(new KeyboardEvent("keydown", { key }));
  for (let i = 0; i < text.length; i++) { keydown(text[i]); await sleep(50); }
})();

In Firefox:
  • Click on Hamburger button to break out from VNC focus
  • Ctrl + Shift + I to open web console
  • Paste the code and confirm
  • You'll be prompted for text to type, confirm

For updates and suggestions, comment here: https://gist.github.com/stil/54052d846c9e77e9da4f79af4c831bf5
If there is enough interest I could prepare a Chrome/FF addon so it's quicker to use
 
Last edited:
  • Like
Reactions: patch

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!