Hello,
Since this is google's #1 thread about clipboard using through proxmox VMs
I wanted to add
For windows VMs
I use the Ditto clipboard manager, both on my workstation and inside the VM because it has a feature to copy clipboard "clips"over the network.
This allows you to copy and paste: text, images and files as easily as if you were on the same computer
It is an excellent open source project
https://ditto-cp.sourceforge.io/
This software gives you a shortcut for the clipboard manager CTRL+~
And here is what sending a "clip" to another computer looks like
![1738348398110.png 1738348398110.png](https://forum.proxmox.com/data/attachments/81/81449-bff46f247a98af820a8dbdb8e4da7c20.jpg?hash=PPg-sE7sPe)
But wait there is more !
In advanced option you will also find On Paste Scripts
![1738348466314.png 1738348466314.png](https://forum.proxmox.com/data/attachments/81/81450-2b86aa79cac709faedd619841c7188fe.jpg?hash=7p1L2NJeEL)
These are scripts you can use to paste with special properties, used via the "Special paste" submenu
![1738348534110.png 1738348534110.png](https://forum.proxmox.com/data/attachments/81/81451-6efe69db28b9dc42f8f719c08b4989c8.jpg?hash=NL69NHQmh8)
And my other idea is to create a On Paste Script which calls AutoHK and paste the text of the clip by simulating keystrokes one at a time
I have not yet succeeded in making this script yet but here is my best effort so far
This On Paste Script, does not work, conceptual only
My main issue is calling the AutoHK executable, not sure how to do that yet
Here is the documentation
https://github.com/sabrogden/Ditto/wiki/Scripting
Since this is google's #1 thread about clipboard using through proxmox VMs
I wanted to add
For windows VMs
I use the Ditto clipboard manager, both on my workstation and inside the VM because it has a feature to copy clipboard "clips"over the network.
This allows you to copy and paste: text, images and files as easily as if you were on the same computer
It is an excellent open source project
https://ditto-cp.sourceforge.io/
This software gives you a shortcut for the clipboard manager CTRL+~
And here is what sending a "clip" to another computer looks like
![1738348398110.png 1738348398110.png](https://forum.proxmox.com/data/attachments/81/81449-bff46f247a98af820a8dbdb8e4da7c20.jpg?hash=PPg-sE7sPe)
But wait there is more !
In advanced option you will also find On Paste Scripts
![1738348466314.png 1738348466314.png](https://forum.proxmox.com/data/attachments/81/81450-2b86aa79cac709faedd619841c7188fe.jpg?hash=7p1L2NJeEL)
These are scripts you can use to paste with special properties, used via the "Special paste" submenu
![1738348534110.png 1738348534110.png](https://forum.proxmox.com/data/attachments/81/81451-6efe69db28b9dc42f8f719c08b4989c8.jpg?hash=NL69NHQmh8)
And my other idea is to create a On Paste Script which calls AutoHK and paste the text of the clip by simulating keystrokes one at a time
I have not yet succeeded in making this script yet but here is my best effort so far
This On Paste Script, does not work, conceptual only
Code:
// Function to escape AHK special characters
def escapeAHKSpecialChars(text) {
// Example: escape curly braces
text = text.replace("{", "{{}");
text = text.replace("}", "{}}");
// Extend this with other necessary escape rules for AHK
return text;
}
// Initialize the AHK script with setup commands
var processedText = "SetTitleMatchMode, 2\n\n";
processedText += "IfWinExist, WRITE THE NAME OF YOUR WINDOW HERE\n";
processedText += "{\n WinActivate\n Sleep, 500\n\n";
// Retrieve the clipboard content
var allText = clip.GetAsciiString();
var start = 0;
var end = allText.find("\n", start);
// Iterate through each line in the clipboard content
while (start < allText.size()) {
// Extract the current line. If 'end' is -1, it means no newline character was found, so take the rest of the string.
var line = "";
if (end != -1) {
line = allText.substr(start, end - start);
start = end + 1; // Move to the start of the next line
end = allText.find("\n", start);
} else {
// This handles the last line or a single-line input
line = allText.substr(start);
start = allText.size(); // This will terminate the loop
}
// Escape special characters and append the line to the AHK script
var escapedLine = escapeAHKSpecialChars(line);
processedText += " SendRaw, " + escapedLine + "{Enter}`n";
}
// Finalize the AHK script
processedText += " ExitApp ; Exits the script\n}\n";
processedText += "else\n{\n MsgBox, The specified window was not found.\n ExitApp ; Exits the script if the window is not found\n}\n";
// Output the AHK script. This might need adjustment based on Ditto's capabilities
print(processedText);
return false; // Prevent the default paste action
My main issue is calling the AutoHK executable, not sure how to do that yet
Here is the documentation
https://github.com/sabrogden/Ditto/wiki/Scripting