How To Copy A Text To A Virtual Machine

How To Copy A Text To A Virtual Machine Average ratng: 8,2/10 604 votes

Copy the pcoip.adm template and paste it on your domain controller’s desktop/whereever you modify group policies for the domain. Create a new policy on the OU that you want for your virtual desktops (view clients) Edit the policy; Expand Computer Configuration-Policies; Right click on Administrative Templates and click Add/Remove Templates.

How To Copy A Text To A Virtual Machine

This comes, once again, from the department of 'Should be working out of the box.' Have you ever needed to type out a long string of text, a line of code, URL, or paragraph, into your VirtualBox guest—knowing said text is sitting there, waiting patiently, on your host? You want to simply copy and paste it, but the action never seems to work.

What if you could make that feature actually work? Better yet, what if you could enable the action so that it would work both ways (from host to guest and guest to host)? That would make working with VirtualBox significantly easier. Well, it's time you made that a reality. And I'm going to show you how.

I'll be demonstrating this on an Elementary OS host and a Fedora 26 guest. The process will be similar for nearly any platform (you'll just need to adjust one particular step). Minecraft gun mods for ps3.

Install Guest Additions

This is the sticking point. Without the Guest Additions installed, copy and paste will not work. I'm going to walk you through the process of installing the Guest Additions that should work on any Linux distribution (you will have to modify the installation command to suit your distribution's package manager). This process will be similar on a Windows host, only you shouldn't have to mount the drive, and you can simply double-click the .exe installer file.

For installing the Guest Additions on Linux, here's what to do:

  1. Start VirtualBox.
  2. Start the host in question.
  3. Once the host has booted, click Devices Insert Guest Additions CD Image.
  4. Open up a terminal window in the guest.
  5. Mount the CD-ROM with the command sudo mount /dev/cdrom /mnt.
  6. Change into the mounted directory with the command cd /mnt.
  7. Install the necessary dependencies with the command sudo dnf install -y dkms kernel-devel kernel-devel-$(uname -r).
  8. Change to the root user with the command sudo su.
  9. Install the Guest Additions package with the command ./VBoxLinuxAdditions.run.
  10. Allow the installation to complete.

If you're working with a Ubuntu-based guest, the command to install the necessary dependencies is sudo apt-get install -y dkms build-essential linux-headers-generic linux-headers-$(uname -r).

One the installation is finished, reboot the guest operating system.

Enable copy and paste

At this point, copy and paste (from either guest to host or host to guest) can be enabled. Start the VM, and once it's booted, click Devices Shared Clipboard Bidirectional (Figure A).

Figure A

You can now copy and paste from guest to host and host to guest. No more having to retype lines of code or URLs and no more wondering why the feature wasn't working.

A bonus feature that still doesn't work

One nice bonus to this is that adding the Guest Additions also allows the enabling of Drag and Drop. Or it should. To enable the feature, click Devices Drag and Drop Bidirectional. There is one caveat to this, in that Drag and Drop doesn't work with every desktop or every file manager. The feature will not work with Elementary OS, or most desktops that depend upon Wayland. The chances Drag and Drop will not work for you are slim. If so, you'll need to make use of Shared Folders (until the developers work out the associated Drag and Drop bugs).

Cloud Insights Newsletter

Your go-to knowledge base for the latest about AWS, Microsoft Azure, Google Cloud Platform, Docker, SaaS, IaaS, cloud security, containers, the public cloud, the hybrid cloud, the industry cloud, and much more. Delivered Mondays

Sign up today Sign up today

Also see

  • How to install VirtualBox Guest Additions on a GUI-less Ubuntu server host (TechRepublic)
  • How to install phpVirtualBox for cloud-based VirtualBox management (TechRepublic)
  • How to install Virtualmin for a web-based VirtualBox dashboard (TechRepublic)
  • How to add new drives to a VirtualBox virtual machine (TechRepublic)
  • VirtualBox: Everything the pros need to know (TechRepublic)
  • How to connect VirtualBox VMs to your company network (TechRepublic Video)
  • VMware turns to sci-fi writers to explain virtualization (ZDNet)

Install latest Guest Additions ^

Before you can work with copy and paste, you have to install the VirtualBox guest additions. Once you start the virtual machine, click the Devices menu, and then select Insert Guest Additions CD image.

Install VirtualBox Guest AdditionsMachine

The Guest Additions CD image should be mapped to drive D:.

CD drive Virtual Guest Additions

To install the Guest Additions launch VBoxWindowsAdditions.exe. After you reboot the virtual machine, you can enable copy/paste on the Devices menu of the VM under Shared Clipboard. If you are testing software that you don’t trust, you might want to only enable Host To Guest. I usually enable bidirectional shared clipboard when I am working with multiple virtual machines, so I can copy and paste from VM to VM.

Enable copy and paste in VirtualBox

You also can enable copy/paste in the VM’s General settings on the Advanced Tab. The VM settings can be opened in the VirtualBox Manager or through the key combination HOST + S.

Shared clipboard in VM settings

Update Guest Additions ^

This is the theory. In practice, I found that copy/paste often isn’t working properly. One possible cause is that you are working with outdated Guest Additions. This is often the case if you updated the VirtualBox but not the Guest Additions on the VM. If you didn’t use the VM for a while and copy/paste causes problems, you should reinstall the Guest Additions.

Reboot the virtual machine ^

Sometimes, the shared clipboard works just fine for a while, and then suddenly you no longer have access to the host clipboard on the VM. This can happen for various reasons. One problem I often encounter is that, after I hibernate the host or the guest, copy/paste no longer works even though it is still enabled in the VM settings. Rebooting the VM usually solves the problem. In some cases, I also had to reboot the host.

Restart the Guest Additions Tray Application ^

If you are in the middle of a test with numerous open applications and windows, rebooting the VM can be very annoying just for making copy and paste work again. In these situations, you can just restart the VirtualBox Guest Additions Tray Application. Open Task Manager by right-clicking the taskbar on the virtual machine and then selecting Start Task Manager (CTRL+SHIFT+ESC doesn’t work in VirtualBox VMs). Search for VirtualBox Guest Additions Tray Application on the Processes tab. (Don’t confuse it with the VirtualBox Guest Additions Service.) Right-click the process and select Open file location. Next, you can end the Guest Additions Tray Application task.

Restart VirtualBox Guest Additions Tray Application

Now, locate VBoxTray.exe in File Explorer and double-click the file to restart the Tray Application.

How To Copy A Text To A Virtual Machine Online

VBoxTray.exe in File Explorer

If you often have problems with copy/paste operations in VirtualBox, restarting the Tray Application through the Task Manager is perhaps a bit cumbersome. As an alternative, you can restart the Tray Application with the little PowerShell script below.

How to copy a text to a virtual machine download

How To Copy Text From Host To Virtual Machine

Stop-Process -Name VBoxTray
Sleep 5
Start-Process C:Windowssystem32VBoxTray.exe

Win the monthly 4sysops member prize for IT pros

10+

How To Copy A Text To A Virtual Machine Download

Related Posts

How to restart VMware ESXi management agents
Troubleshoot an unresponsive VMware vSphere VM
Posted on