My Windows laptop uses a VirtualBoxed Linux machine to connect to a remote machine, both using Ubuntu 14.04 LTS. On the remote machine I look at files using nano or less. How do I copy part or all of a file from inside these terminal applications and then paste this text into my local machine (as a file or into a file via e.g. gedit)? For reasons I won't go into, I can't scp from the remote machine.

  • 1
    Have you already tried setting "Shared clipboard" to "Bidirectional" in VM settings? Aug 7 '16 at 16:36
  • How are you connecting to the remote machine? Do you want to paste in the VM or in the host? Why aren't you connecting directly from the host? Why can't you use scp — there's a high chance that this is relevant? Aug 7 '16 at 21:23

If you're using a graphical terminal program (like xterm) you should just be able to copy text from the window like normal.


You can use sshfs to mount the remote machine as a local directory in your VM and look at, copy and edit the files on the remote machine.

The syntax used is

sshfs remote_user@remote_computer:/full/path/to/directory /path/to/local/directory

For shared clipboard to work, be sure to install the VirtualBox Extension Pack on your local machine, and install the Guest Additions on the VM you're using.

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.