issues with copy/paste on Ubuntu Server VM

Discussions related to using VirtualBox on Mac OS X hosts.
antoaunix
Posts: 8
Joined: 23. Jul 2021, 01:56

issues with copy/paste on Ubuntu Server VM

Post by antoaunix »

hello, this is my first post

i use virtual box mainly for testing purposes. I am currently running VB 6.1.22 r144080 (Qt5.6.3) on OSX Catalina 10.15.7.
I am going crazy trying to have copy and paste work on a ubuntu server 18.04.5 LTS virtual machine. What have i tried already?

  • going to the VM preferences -> advanced -> Shared Clipboard as well as Drag'n'Drop set with Bidirectional (still no copy/paste)
  • sudo apt install virtualbox-guest-x11 and service virtualbox-guest-utils start (install but does nothing)
  • VBoxClient-all (command not found)
  • VBoxClient --clipboard (nothing happen)

how can i fix this? it's so annoying to type web addresses and long commands...
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: issues with copy/paste on Ubuntu Server VM

Post by scottgus1 »

Guest Additions (and the prerequesites beforehand) need to be installed in the VM for shared clipboard to work. See https://www.virtualbox.org/manual/ch02. ... nux-prereq and https://www.virtualbox.org/manual/ch04. ... ions-linux

If you install these and still don't have shared clipboard, please post a vbox.log:

Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show Log. Save the far left tab's log, zip it, and post the zip file, using the forum's Upload Attachment tab.
antoaunix
Posts: 8
Joined: 23. Jul 2021, 01:56

Re: issues with copy/paste on Ubuntu Server VM

Post by antoaunix »

scottgus1 wrote:Guest Additions (and the prerequesites beforehand) need to be installed in the VM for shared clipboard to work. See

If you install these and still don't have shared clipboard, please post a vbox.log:

Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show Log. Save the far left tab's log, zip it, and post the zip file, using the forum's Upload Attachment tab.
Thank you Scott, the link you sent me aren't supposed to be for a linux host? i have an iMac, the ubuntu server is the VM... so if i'm correct i need to install the guest additions on my mac host? isn't it? where can i find the documentation for that? thanks
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: issues with copy/paste on Ubuntu Server VM

Post by mpack »

antoaunix wrote: Thank you Scott, the link you sent me aren't supposed to be for a linux host?
The procedure for installing "prerequisites" is the same on a Linux guest as it is for the Linux host, so the GAs section refers you to an earlier description given in a Linux hosts section of the manual. I.e. the section Scott referred you to is correct.

I don't much care for that kind of cross referencing, and that one in particular strikes me as a tad awkward. Normally I would submit a suggested edit, but I'm not enough comfortable enough with Linux to do that this time.
granada29
Volunteer
Posts: 690
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: issues with copy/paste on Ubuntu Server VM

Post by granada29 »

antoaunix wrote: ... so if i'm correct i need to install the guest additions on my mac host? isn't it? where can i find the documentation for that? thanks
No - The Guest Additions are installed in your Linux VM.

To add the CD image to the VM:
1. Give your VM window focus
2. In the Devices Menu on your Mac Menubar - select the item Insert Guest Additions CD Image ...
3. Mount the CD image in your VM - There are a few ways to do this in Linux. If you have a desktop environment you *may* get a popup. Alternatively you could mount the image from a commandline shell session
4. Run the Linux additions installation script that is in the now mounted CD image
antoaunix
Posts: 8
Joined: 23. Jul 2021, 01:56

Re: issues with copy/paste on Ubuntu Server VM

Post by antoaunix »

first of all thanks to all the people that replied.
i tried to make it from scratch to avoid mistakes... here's the step i took
  1. created new ubuntu server VM
  2. inserted from the device menu the Guest Additions CD Image
  3. went to media folder and created a cdrom1 folder cd /media | sudo mkdir cdrom1
  4. mounted the drive sudo mount /dev/cdrom /media/cdrom1
  5. entered the cdrom1 folder cd cdrom1/
  6. installed the additions sudo ./VBoxLinuxAdditions.run
  7. reboot the machine sudo reboot
still doesn't work... is it seriously this hard to just enable a simple copy/paste????
pleeeease help me get out of this status :D

here you can see my log file (i tried to attach it but it's too big)
filemail[dot]com/d/cnvsayaddnpxtlp
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: issues with copy/paste on Ubuntu Server VM

Post by scottgus1 »

The listed process does not include installing the prerequisites.
antoaunix should have wrote:
  1. created new ubuntu server VM
  2. installed the prerequistes from https://www.virtualbox.org/manual/ch02. ... nux-prereq
  3. inserted from the device menu the Guest Additions CD Image
  4. went to media folder and created a cdrom1 folder cd /media | sudo mkdir cdrom1
  5. mounted the drive sudo mount /dev/cdrom /media/cdrom1
  6. entered the cdrom1 folder cd cdrom1/
  7. installed the additions sudo ./VBoxLinuxAdditions.run
  8. reboot the machine sudo reboot
Both Virtualbox on the host and Guest Additions in the VM require the prerequisites. An explanation for why this prerequisite stuff is not done by the GAs installer is given in one of the two links I posted above.
antoaunix wrote:here you can see my log file
Zipped logs fit. The instructions I posted about posting a log did mention to use a zip file.

But do the prereqs first, then install the GAs, both in the VM. Then if shared clipboard doesn't start working, then zip and post the log.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: issues with copy/paste on Ubuntu Server VM

Post by mpack »

antoaunix wrote: is it seriously this hard to just enable a simple copy/paste????
"Simple"? I don't know of anybody that lets you copy/paste between PCs without needing to install software first, let alone between PCs running entirely different Operating Systems with mismatched UIs.
antoaunix
Posts: 8
Joined: 23. Jul 2021, 01:56

Re: issues with copy/paste on Ubuntu Server VM

Post by antoaunix »

scottgus1 wrote:The listed process does not include installing the prerequisites.
antoaunix should have wrote:
  1. created new ubuntu server VM
  2. installed the prerequistes
  3. inserted from the device menu the Guest Additions CD Image
  4. went to media folder and created a cdrom1 folder cd /media | sudo mkdir cdrom1
  5. mounted the drive sudo mount /dev/cdrom /media/cdrom1
  6. entered the cdrom1 folder cd cdrom1/
  7. installed the additions sudo ./VBoxLinuxAdditions.run
  8. reboot the machine sudo reboot
Both Virtualbox on the host and Guest Additions in the VM require the prerequisites. An explanation for why this prerequisite stuff is not done by the GAs installer is given in one of the two links I posted above.
antoaunix wrote:here you can see my log file
Zipped logs fit. The instructions I posted about posting a log did mention to use a zip file.

But do the prereqs first, then install the GAs, both in the VM. Then if shared clipboard doesn't start working, then zip and post the log.
thanks for your help! actually i'm kinda lost on what to do for prerequisites... i'll tell you my exact steps so you see if i misunderstood something about the prereq.
  1. deleted the old VM and all related files
  2. created a new ubuntu server vm and installed the os
  3. on VBox app i went to preferences > general > advanced and selected bidirectional both for shared clipboard and for drag n drop
  4. sudo apt-get update -y for updating
  5. sudo apt-get install -y qt5-default for installing QT
  6. sudo apt-get install -y libsdl2-dev for installing SDL
  7. sudo apt-get remove virtualbox-dkms | sudo apt-get install virtualbox-dkms installing the driver
  8. uname -a to get the uname
  9. sudo apt-get install build-essential linux-headers-4.15.0-151-generic dkms virtualbox-dkms installing the header
  10. sudo modprobe vboxdrv | sudo modprobe vboxnetflt enabling the drivers
  11. inserted from the device menu the Guest Additions CD Image
  12. went to media folder and created a cd1 folder cd /media | sudo mkdir cd1
  13. mounted the drive sudo mount /dev/cdrom /media/cd1
  14. entered the cdrom1 folder cd cd1/
  15. installed the additions sudo ./VBoxLinuxAdditions.run
  16. reboot the machine sudo reboot


what am i missing? it still doesn't work... did i misunderstood prereq ?
Thanks
Attachments
CKAD-2021-07-23-20-37-40.log.zip
(32.2 KiB) Downloaded 9 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: issues with copy/paste on Ubuntu Server VM

Post by scottgus1 »

I'm happy to report that the GAs did install:
00:30:34.274651 VMMDev: Guest Additions information report: Version 6.1.22 r144080 '6.1.22'
However, I don't know if the VM ran long enough to try shared clipboard:
00:30:28.972710 VMMDev: Guest Log: BIOS: Booting from Hard Disk...
00:30:34.274651 VMMDev: Guest Additions information report: Version 6.1.22 r144080 '6.1.22'
00:30:53.787483 Changing the VM state from 'RUNNING' to 'SUSPENDING'
That's only 25 seconds of run time from boot to GAs to turn-off. I wonder if the VM OS services that have to start had time.

Try again, double check shared clipboard Bidirectional is on in the VM, and leave it sit for a few minutes so the OS can stabilize.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: issues with copy/paste on Ubuntu Server VM

Post by fth0 »

Skimming this thread, I may have overlooked something, but I think nobody asked if you're using a GUI (X11/Wayland)?

Linux server variants are often used without a GUI, and the VirtualBox Clipboard doesn't work without X11 or Wayland. When using SSH to connect to the Linux guest OS, copy and paste should work as usual (CMD-X/C/V from the macOS SSH client).
antoaunix
Posts: 8
Joined: 23. Jul 2021, 01:56

Re: issues with copy/paste on Ubuntu Server VM

Post by antoaunix »

scottgus1 wrote:I'm happy to report that the GAs did install:
00:30:34.274651 VMMDev: Guest Additions information report: Version 6.1.22 r144080 '6.1.22'
However, I don't know if the VM ran long enough to try shared clipboard:
00:30:28.972710 VMMDev: Guest Log: BIOS: Booting from Hard Disk...
00:30:34.274651 VMMDev: Guest Additions information report: Version 6.1.22 r144080 '6.1.22'
00:30:53.787483 Changing the VM state from 'RUNNING' to 'SUSPENDING'
That's only 25 seconds of run time from boot to GAs to turn-off. I wonder if the VM OS services that have to start had time.

Try again, double check shared clipboard Bidirectional is on in the VM, and leave it sit for a few minutes so the OS can stabilize.
just tried, 5 minutes uptime but still nothing :( i did check for bidirectional, it seems all fine :(
antoaunix
Posts: 8
Joined: 23. Jul 2021, 01:56

Re: issues with copy/paste on Ubuntu Server VM

Post by antoaunix »

fth0 wrote:Skimming this thread, I may have overlooked something, but I think nobody asked if you're using a GUI (X11/Wayland)?

Linux server variants are often used without a GUI, and the VirtualBox Clipboard doesn't work without X11 or Wayland. When using SSH to connect to the Linux guest OS, copy and paste should work as usual (CMD-X/C/V from the macOS SSH client).
yeah i'm not using the GUI... there is completely no method for using it? i think i had seen some video on youtube where it was working... but i'm not sure. now i'm curious to learn and fix... but actually with ur suggest i could use copy and paste!!!! i installed openssh server and am just using the server from my host terminal! thank you so much! finally i don't have to type long urls :D
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: issues with copy/paste on Ubuntu Server VM

Post by scottgus1 »

Ah, yes, no gui! fth0 takes the prize!
antoaunix
Posts: 8
Joined: 23. Jul 2021, 01:56

Re: issues with copy/paste on Ubuntu Server VM

Post by antoaunix »

scottgus1 wrote:Ah, yes, no gui! fth0 takes the prize!
so no fix for poor guy no gui? :D i mean, aside the ssh workaround
Post Reply