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

24,838

Solution 1

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

Solution 2

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

Share:
24,838

Related videos on Youtube

Howard Lee
Author by

Howard Lee

Updated on September 18, 2022

Comments

  • Howard Lee
    Howard Lee almost 2 years

    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?

    • Eugen Rieck
      Eugen Rieck over 9 years
      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.
    • Howard Lee
      Howard Lee over 9 years
      This is a smart alternative. Thanks for input!
  • pabouk - Ukraine stay strong
    pabouk - Ukraine stay strong over 9 years
    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).
  • mja
    mja over 7 years
    Work like a charm!
  • Syndog
    Syndog about 6 years
    Excellent idea suggesting SSH as an alternative solution, if all else fails. Sometimes that's the best option anyway. (Also upvoted Eugen's comment.)