# "PASTE" from linux desktop to terminal window

# Background

I have been working a bunch in [Proxmox](https://www.proxmox.com) lately, specifically with [OpenWRT](https://openwrt.org). I managed to get it installed as a VM, but having trouble with getting to it from the client VM ([Linux Mint](https://linuxmint.com)). I need to do some commands in the Proxmox terminal view, as I can not get to it from the "network".

↑ [audio](https://share.ue.internxt.com/sh/file/lNCoop6CS2inXXSbyaIMNA/cO_N5xgf)

I am a copy/paste person. You can not paste a command in the terminal. Works on the server (host) terminal, but not for the VMs. After a long, hard 2 days of searching, I found at least a way to "paste" from my machine to the terminal. I want to put this out to others so that maybe someone else will find a quick solution in their web search.

↑ [audio](https://share.ue.internxt.com/sh/file/0ps7VBZCS_CLCr1GwaeHJA/5E7rSR-f)

# "paste" sort of

↑ [audio](https://share.eu.internxt.com/sh/file/nqCtWp0DTli_xdCVWtpIeg/VbP4trTL)

The hack will take the contents of your clipboard and issue keystrokes where the cursor is. Not exactly paste, but close enough. Still will not copy in the terminal and allow me to paste locally (iPv6 addresses are a pain!), but it is a start and a fix to half my problem. I have made the transition for my daily driver to be [Linux Mint](https://linuxmint.com), so this is from a Linux OS/laptop ([Framework](https://frame.work) rocks!).

After many hours searching, I found an answer in an old Proxmox forum posting:

[https://forum.proxmox.com/threads/novnc-copy-paste-not-works.19773/post-101013](https://forum.proxmox.com/threads/novnc-copy-paste-not-works.19773/post-101013)

↑ [audio](https://secure.eu.internxt.com/sh/file/kgE_BM3oQh6lWZUyi29nsA/hzsgNMLB)

<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">NOTE: <code>xdotool</code>works only for an <a target="_self" rel="noopener noreferrer nofollow" href="https://en.wikipedia.org/wiki/X_Window_System" style="pointer-events: none">X11 windows system</a>. If you are using <a target="_self" rel="noopener noreferrer nofollow" href="https://en.wikipedia.org/wiki/Wayland_(protocol)" style="pointer-events: none">Wayland</a>, you might also reference <a target="_self" rel="noopener noreferrer nofollow" href="https://askubuntu.com/questions/212154/create-a-custom-shortcut-that-types-clipboard-contents" style="pointer-events: none">https://askubuntu.com/questions/212154/create-a-custom-shortcut-that-types-clipboard-contents</a> and the <code>ydotool</code> [ <a target="_self" rel="noopener noreferrer nofollow" href="https://packages.debian.org/experimental/ydotool" style="pointer-events: none">Debian</a> ] <a target="_self" rel="noopener noreferrer nofollow" href="https://github.com/ReimuNotMoe/ydotool" style="pointer-events: none">[</a> <a target="_self" rel="noopener noreferrer nofollow" href="https://github.com/ReimuNotMoe/ydotool" style="pointer-events: none">GitHub</a> <a target="_self" rel="noopener noreferrer nofollow" href="https://github.com/ReimuNotMoe/ydotool" style="pointer-events: none">]</a>. <code>ydotool</code> will require a background daemon to run for it to work as noted in the GitHub <code>README</code>.</div>
</div>

↑ [audio](https://secure.eu.internxt.com/sh/file/RF8YL8_VREaELGX_snb_sQ/17aQuk3U)

# THE STEPS

---

Install `xdotool` \[ [Debian](https://packages.debian.org/trixie/xdotool) \] \[ [GitHub](https://github.com/jordansissel/xdotool/) \] and `xclip` \[ [Debian](https://packages.debian.org/trixie/xclip) \] \[ [GitHub](https://github.com/astrand/xclip) \] on your workstation.

↑ [audio](https://secure.ue.internxt.com/sh/file/PlmkRa5kTX-bzHD6zHh6IQ/VJCD1T9Z)

```bash
sudo apt install xdotool xclip
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1755949484190/19c9e6f3-5983-41d4-95ce-1a051989c1e2.gif align="center")

---

Open up the Keyboard settings and click on shortcuts tab.

↑ [audio](https://secure.internxt.com/sh/file/HOxdgLMRQzWFzl4iLxB_Tg/sE5gfYGD)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1755951431173/ff00eab9-831f-46e6-8baa-536a4918f61a.gif align="center")

---

Create a new custom shortcut named whatever you like, "SendKeys" in my case.  
Add the following command:

↑ [audio](https://share.eu.internxt.com/sh/file/8QpphGjgQiCF2mv6626kSg/eh84iPr-)

```bash
sh -c 'sleep 1.0; xdotool type "$(xclip -o -selection clipboard)"'
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1755962722740/bcdbf12e-6515-4c0f-a4bf-6a0068ada1a1.gif align="center")

---

Assign the keys you wish to use. I use ALT-V.

↑ [audio](https://share.eu.internxt.com/sh/file/BuHAF_8QSRCu2HIy3EkcvA/3V65AMC9)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1755963937062/31cd39ad-e945-4de9-ba13-a8f54930f9d7.gif align="center")

---

# Conclusion

This is somewhat of a hack. But it works, and is fairly non-intrusive.

↑ [audio](https://share.ue.internxt.com/sh/file/JhWicIM6Qu6Z1mhnuxVSyg/WgKZsZ3y)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1755967659602/5430610a-b724-43ce-bd2b-641984f341b6.webp align="center")

---

---

Resources used:

* [Hashnode](https://hashnode.com/)
    
* [Gifcurry](https://github.com/lettier/gifcurry)
    
* [OpenShot Video Editor](https://www.openshot.org/)
    
* [ttsfree.com](http://ttsfree.com)
    
* [Ezgif.com](https://ezgif.com/)
