How-to Copy-Paste into the Ubuntu-for-Server Terminal?

I have been searching for a way to copy-paste from my host system into a VMWare guest running Ubuntu-for-Server.

I’ve Google Fu’d for a few hours and tried various things that I have found online, but none of them have worked:

  1. uninstall open-vm-tools and install open-vm-tools-desktop
  2. installed xclip
  3. installed gpm (does make a mouse barely usable, but it is essentially worthless)
  4. since it is a headless OS\terminal, CTRL + SHIFT + C\V do not work (doesn’t work even with the wonky gpm mouse cursor)

Based upon this discussion at Stack Overflow (which goes sideways and on tangents unrelated to the original question):

Copy Paste Command in Text Based Linux Server (No GUI)

Anyone have suggestions that I might explore to make copy-paste work in Ubuntu-for-Sever ?

  • Install a GUI or “desktop” package on Ubuntu-for-Server virtual machine ?
  • Install a terminal emulator on Ubuntu-for-Sever virtual machine ?
  • Just use ssh from the VMWare host to the Ubuntu-for-Server virtual machine ?

Thanks

I gave bad advice on this one originally. Best option I can offer is to use SSH.

More often than not, I just setup SSH first (almost always actually), as I’m going to use it more often than not, particularly with servers. Then I can use my workstation as normal.

Thanks @KI7MT .

I have bidirectional clipboard enabled in VMWare. It is auto-enabled by default in VMWare tools. Actually, there is no copy-paste that works with Virtualbox either when attempting to copy-paste from the host into the Ubuntu-for-Server virtual machine.

Its working for me in VBox. Granted, this is a Desktop Guest. I can load up a server and check it out also.

Well, @runlinux.run, I stand corrected. It used to work fairly easy, but not any more, or at least it’s not working in UB server. It would appear one needs an Xserver running, and that’s just a non-starter for me on a server. Even their documentation says is should work: Guest Additions

So, sorry for the mis-lead on that one. I guess the next best option is just to use SSH.

1 Like

And I can confirm, once you install a desktop of any sort, copy and paste works as they say is should. What a Zoo that is.

I still would not do that just for C&P functions. I would SSH to the box, but, that’s up to the individual I suppose.

I’m certain this functionality worked in the past, but, I dang sure can’t get it working now.

I’ve never had an issue with in Virtualbox. It can be disabled, so maybe check that. But, when it enabled it works bi-bidirectionally.

Out of curiosity, which desktop did you install in UbfS ?

I installed Xfce, but I also installed a bunch of other junk before getting to that point (without success). I’ll do another default install and see what the min packages are.

Ubuntu Server with Xubuntu Core Install for Copy & Paste

Note : This is how I do it. There are definitely more, and probably better, ways of accomplishing this. This method works for me so I use it, YMMV.

This is a lot of work for something that can be done via SSH, and probably should be for strict server use. I chose Xubuntu-Core as it’s “supposed” to be the lightest weight version of XFce packaged by Ubuntu.

VBox Setup

  1. Set whatever you need in CPU, Disk and Memory
  2. Under Settings >> General >> Advanced
  • Set Share Clipboard to Bidirectional
  • I also set shared folders to Bidirectional
  1. Performed a default installation and enabled OpenSSH
  2. After reboot performed the following:

Post Install Updates


# update and upgrade

sudo apt update
sudo apt upgrade -y

# after a big update, I reboot the box

sudo reboot

# back at the prompt, install XFce

sudo apt install xubuntu-core -y

# When prompted, select lightdm for the display manager

# Sit back and have a beer, this takes a while, even on a fast box

# reboot again

sudo reboot

Virtual Box Guest Additions

At this point, and after reboot, you should see the display manager rather than the console. I log in and install Guest additions. On the VM menu under Device, select Install Guest Additions CD image…

You should see the CD appear on the desktop.

Before running the VBox install script, install dkms


#  install dkms
sudo apt install dkms

# cd to cdrom and install guest additions

# note, get the version from the directory name with `ls`

cd /mnt/$USER/VBox_GAs_<version>

# run the script, in my case it was

sudo bash VBoxLinuxAdditions.sh

# reboot, again !

sudo reboot

Test Copy & Paste

Once you log back in the second time, you should be able to Copy and Paste. That’s a lot of pain that SSH can do away with.

Install NeoFetch

I almost forgot the most important part, installing neofetch


# you should be able to Copy & Paste this command as a test

sudo apt install neofetch -y && clear && neofetch

xubuntu-neofetch

2 Likes

Thank you @KI7MT .

I agree it is a hassle for most people, but when learning there have been instances where copy-paste would save me a lot of time.

It looks like a good procedure. :+1:

1 Like