10

I've installed the 64bit edition of Ubuntu Minimal 14.04 in a VMware Player virtual machine. Ubuntu Minimal only has a CLI (Command Line Interface), which I like, but I can't figure out how to copy/paste in the terminal. I need paste especially, because some of the links I need to run are just too long to type manually.

I've tried Ctrl+V, Ctrl+Shift+V, Shift+Insert, Ctrl+Shift+Insert, but so far no luck. How can I copy/paste in the CLI?

2
  • 3
    I recommend installing ssh server, then connecting to the VM with the SSH client of your choice, e.g. PuTTY - this offers not only easy cut&paste, but also a resizable text console and other goodies. Oct 17 '14 at 22:25
  • 1
    This is a smart alternative. Thanks for input!
    – Howard Lee
    Oct 20 '14 at 18:34
6

VMware Workstation 12.5.2 supports general paste (UPDATE)

By accident I noticed that the current version of Workstation (12.5.2) supports general paste. I mean paste anywhere including the Linux text console without need to have any VM tools installed. A similar function was available in Microsoft Virtual PC.

The function works by emulating key presses. This implies the following limitations:

  • The keyboard layout of the VM must match the keyboard layout that VMware Workstation expects. Otherwise the characters on keys which differ will be entered wrongly.
  • The expected keyboard layout in my case was "United States" though I use a different layout both in my host and guest machine.
  • There does not seem to be a (simple) way how to change the expected keyboard layout.
  • Only paste works this way. Copy works only the old way with the support of VMware tools.

I know about two ways how to invoke the function:

  1. Have the VM window selected but the keyboard not grabbed (Ungrab using Ctrl+Alt or select the VM window by clicking the VM tab.) then press Ctrl+V.
  2. Have the VM window selected and use the function from the menu: Edit > Paste

There are additional limitations:

  • There does not seem to be a shortcut using the VMware hot key Ctrl+Alt which would allow using the function while the keyboard is grabbed.
  • The function does not seem to be accessible from VMware 12 Player (version 12.5.2). Ctrl+V does not work and there is no Paste function in the menu.
  • The function is described neither in the documentation nor in the release notes.

The other and older products do not support paste outside of X Window System or without VM tools

This is a limitation of VMware products. Unfortunately most of them do not support copying and pasting in a text console of an operating system. The clipboard integration works only in the graphical user interface with working VMware Tools or open-vm-tools installed.

SSH as an alternative solution

When I work with Linux virtual machines without GUI (almost all my Linux virtual machines) I use SSH access as Eugen Rieck suggested already. As he wrote this solution allows also other very useful features. I would certainly name longer and more easily usable scrollback buffer (without need to use terminal managers like screen).

2
  • 1
    Work like a charm!
    – mja
    Mar 2 '17 at 18:50
  • Excellent idea suggesting SSH as an alternative solution, if all else fails. Sometimes that's the best option anyway. (Also upvoted Eugen's comment.)
    – Syndog
    Apr 16 '18 at 19:55
5

Use Control+Shift+C to copy, and use Control+Shift+V to paste.

References

  1. http://howtoubuntu.org/how-to-cut-copy-and-paste-in-the-terminal-in-ubuntu

  2. https://stackoverflow.com/questions/761807/copy-and-paste-from-terminal-with-keyboard-in-linux-ubuntu

1
  • 7
    This works in the GUI (X Window System). But the OP explicitly asks about Linux installation with command line only (i.e. no GUI installed).
    – pabouk
    Oct 24 '14 at 22:02

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.