How make Copy/Paste on VNC kvm in proxmox

Old thread but for anyone still fighting with this I created a little autohotkey v2 script that essentially simulates the keypresses of what's in the clipboard effectively automating typing the content into the VM for you. Been working great for this. I have the hotkey bound to ctrl+alt+v but you can set it to whatever you like by altering the first line. In autohotkey script ^ is ctrl, ! is alt, + is shift, and # is the win key.

Code:
^!v:: { ; Ctrl+Alt+V will trigger this script
    text := A_Clipboard
    if (text == "") {
        MsgBox "Clipboard is empty or not accessible."
    } else {
        text := StrReplace(text, "`r`n", "`n")  ; Normalize line endings
        Loop Parse, text
        {
            SendText(A_LoopField)
            Sleep 10  ; Add a small delay between each keypress to avoid overwhelming the VM
        }
    }
}
 
How I have got it working in Windows VM's and otherwise is as follows in just a couple steps.

  1. select the VM while powered down > Hardware > Display, Advanced enabled. Set to VNC versus default.
  2. Power it up and install spice guest tools like from https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe

Instantly copy and paste support works, even in a Win11 PE it works, so in less than the norm situations as well.
 
@Onoitsu2 Do you know if this works also in Debian guests?

I tried quite a lot of different ways, but didn't find a way to paste something into the guest without installing additional software. How are the spice guest tools supposed to work? Do you need special key combinations?
 
@Onoitsu2 Do you know if this works also in Debian guests?

I tried quite a lot of different ways, but didn't find a way to paste something into the guest without installing additional software. How are the spice guest tools supposed to work? Do you need special key combinations?
Enable it in settings for your VM as I instructed in Step 1, then simply install it. I have only tested on Windows personally. But it likely would work the same way, but should work pretty much the same in the noVNC viewer as for working on a windows system.

Some steps for installing Spice Guest tools on Debian, that explain multiple methods.
https://medium.com/@max.kombarov/in...s-on-a-debian-based-system-in-vm-2bc66fc2d95b
 
AFAIK, those tools only help with the SPICE display. I cannot imagine how they should work with VNC.
Don't ask me HOW it works. Just that it does with the noVNC Proxmox uses. When installing it, and enabling options as I have cited, you can copy and paste into a Windows VM using the option in the noVNC pull out. I stumbled across it posted on some obscure blog back in '21 (offline now, I tried to find it), and have been using it since. So thought I'd put that knowledge out there where some may look most often.
 
I was sceptic, but you're totally right. This works and seems to be new. Haven't seen the clipboard option until now.

1734089010202.png

It's a bit tedious, yet it works!

1734089092485.png
 
  • Like
Reactions: Onoitsu2
I just use SSH with MobaXterm and I can copy and paste to my heart's content. Plus you can open new screens in tabs
 

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!