Ubuntu – How to copy and paste in the command line Interface of Ubuntu Minimal

command linecopy/pasteUbuntuvmware-player

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?

Best Answer

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).

Related Question