8

My computer runs Windows Server 2008 R2. It hosts a Hyper-V virtual machine running Ubuntu 12.04 as the guest OS.

I want to copy text from Ubuntu and paste this text in Windows (and copy text in Windows and paste it in Ubuntu). How can I do this?

2
  • VirtualBox and VMware come with “guest tools”: programs that you install in the guest to get niceties such as shared directories and copy-paste. Does Hyper-V come with guest tools? If so, install them. – Gilles 'SO- stop being evil' Oct 10 '13 at 21:29
  • I use Putty to ssh the Hyper-V machine command prompt. Copy Paste works both ways easily. – Isodata-JP Sep 8 '14 at 12:11
3

You can use ncat - which also has a windows port - to transfer data over network. On one system you run it in "listen" mode, where it binds to some port, on the other system you connect to that port on the other machine. This creates a bi-directional pipe. On Linux you can choose from more variants (GNU netcat, BSD netcat, socat...). Apart from the obvious man page, you can also have a look at the wikipedia netcat article.

Note: on both systems you run these in the terminal (Windows command line, Unix shell) - the copy-paste has to happen twice: on one machine you copy from the source and paste it into the terminal which is running ncat. The data is transferred to the other machine, where you copy it from the terminal to its final destination.

Other option is to exchange files over a Windows share (Samba on Linux).

3
  • Thanks. So I can do "ctrl + c" in Windows Server and then "ctrl + v" in Ubuntu and I copy text. Do I copy text this way after ncat tuning? – novicegis Oct 10 '13 at 14:07
  • No, this doesn't work that easy. :) See updated answer. – peterph Oct 10 '13 at 14:29
  • Thanks for everyone. For a while I use WinSCP for copy file (with text) between this OS. I do not know how long we will work with Ubuntu... – novicegis Oct 11 '13 at 6:59
0

It depends on how you are accessing the guest from the host. Is it the console of the guest through a HyperV connection manager? HyperV has a feature in the Connection Manager to "Type Clipboard Text".

Does the guest run X? There appears to be no native copy/paste functionality between HyperV and X, so you may want to run a remote session using something like VNC or perhaps NX. And aside from the Type Clipboard Text, it looks like you cannot copy on the guest or read from its clipboard.

1
  • Type clipboard text doesn't work with most Linux distros in X11 – Warren P Oct 13 '16 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.