Hyper-V Clipboard and Integration Services in Ubuntu

38

8

I have Ubuntu 14.04 running in Windows Hyper-V. I am experiencing a problem with the Clipboard (copy from host to Virtual Machine), it is not working correctly (It was not working with Ubuntu 12.04 also). I suspect that the problem lies in the Integration Services. Are they enabled by default or do I need to enable them in Ubuntu 14.04 ? Does anyone else experience the same problem with the Clipboard Copy-Paste function ?


Interesting is that in the Hyper-V Clipboard the Capture Screen(Ctrl+C) works as seen in the image below, but Type Clipboard Text (Ctrl+V) does not work.

lsmod | grep hv

Ubuntu 14.04 running in Hyper-V image taken with clipboard screen capture


I have searched the web and found only information about Ubuntu 12.04. This is what has to be done on Ubuntu 12.04: click here. Does this also apply for Ubuntu 14.04 ? If I am correct I do not have to install something (Linux Integration Services 3.5 here), everything is already installed in Ubuntu, but is the procedure the same as in the above link ?


To enable VSS Snapshot daemon and KVP daemon use the following command:

# sudo apt-get update
# sudo apt-get install hv-kvp-daemon-init


Ubuntu virtual machines feature distribution map here

Devid

Posted 2014-03-28T20:43:51.940

Reputation: 5 566

here http://www.serverwatch.com/server-tutorials/installing-and-activating-hyper-v-linux-integration-services.html it's said: Ubuntu Hyper-V Integration Services have been built into Ubuntu Linux since Ubuntu 12.04

– zhangxaochen – 2016-08-02T07:41:57.687

@Devid - What is the answer here? What are we supposed to do? – Alex S – 2017-04-18T07:07:28.707

@AlexS in the Windows 10 Creators Update Microsoft did a lot of updates to Hyper-V. Also Ubuntu is working closer now with Microsoft. I know that they fixed the problem with the resolution, maybe they also fixed this. Sometime later I will check this and report back. Other than that I don't know about a solution that is working correctly till now. – Devid – 2017-04-18T07:22:55.737

Answers

9

Since this question was asked (re ~ Ubuntu 15.04) things have progressed significantly with regards to Hyper-V & Ubuntu 18.04.1 with regards to ‘Enhanced Session Mode’.

There are two approaches currently:

A. New System ~~ Optimized Ubuntu Desktop images available in Microsoft Hyper-V gallery

B. Existing System ~~ manually configure xRDP to support ‘Enhanced Session Mode’

Here are the details:

Option A)

  1. In Hyper-V, on your server & select [Quick Create]
  2. In the [Create Virtual Machine] dialog, select [Ubuntu 18.04.1 LTS] && then [Create Virtual Machine]
  3. Then complete the standard Ubuntu installation options
  4. ‘Enhanced Session Mode’ will prompt you to setup screen resolution, local resources, etc.
  5. Note/Caution ~ if you have problems using drives, then you may want to de-select the [Printers]

Here are the links to where I sourced the information:

Optimised Ubuntu Desktop images available in Microsoft Hyper-V gallery

Run Ubuntu virtual machines made even easier with Hyper-V Quick Create

Option B)

  1. Modify Ubuntu 18.04 to use xrdp

    1.1 Get the scripts from GitHub

    sudo apt-get update
    sudo add-apt-repository ppa:git-core/ppa
    sudo apt update; sudo apt install git
    git clone https://github.com/jterry75/xrdp-init.git ~/xrdp-init
    

    1.2 Make the scripts executable and run them...

    cd ~/xrdp-init/ubuntu/18.04/
    sudo chmod +x install.sh
    sudo ./install.sh
    reboot
    

    1.3 <After Reboot> Run script again to finish setting up VM

    cd ~/xrdp-init/ubuntu/18.04/
    sudo ./install.sh
    
  2. Shutdown Ubuntu VM

  3. Register Ubuntu Session ~ run this command on host PC using powershell with admin rights:

    Set-VM -VMName YourUbuntuVMNameHere -EnhancedSessionTransportType HvSocket
    
  4. Restart VM

  5. Connect/Login to XRDP from Hyper-V (note ~ enter username - must be lowercase)

  6. Note/Caution ~ if you have problems using drives, then you may want to de-select the [Printers]


Here is the link to where I sourced the information:

George 2.0 Hope

Posted 2014-03-28T20:43:51.940

Reputation: 288

There is a better guide now available on the official repo: https://github.com/Microsoft/linux-vm-tools/wiki/Onboarding:-Ubuntu

– JCM – 2019-04-02T20:58:18.363

7

Unfortunately it doesn't work. It looks like the correct answer here is to either:

  1. SSH into your box so you can cut & paste into the your Windows SSH
    window
  2. Use Oracle's VirtualBox. Cut & Paste seems to work there.

Ryan Shillington

Posted 2014-03-28T20:43:51.940

Reputation: 260

2Please stop answering user questions with install another solution. – ZacWolf – 2018-08-05T14:56:30.583

1@ZacWolf In this case, there is no solution. It's just not supported (or at least want at the time). The next step is to list the known work arounds. – Ryan Shillington – 2018-08-05T20:43:00.177

1Workarounds WITHIN the solution of the question, yes, #1 was the correct way to answer. #2 was not. Just my two cents. – ZacWolf – 2018-08-07T01:20:20.033

Both 1 and 2 are useful – Zar Shardan – 2019-09-27T21:38:52.897

1

Doing an lsmod | grep hv on a fresh install of Ubuntu Server 14.04 shows that the Hyper-V modules are already enabled for me.

  • hv_vmbus
  • hv_storvsc
  • hv_blkvsc
  • hv_netvsc
  • hv_utils

You are correct in saying that the Linux Integration Services supplied my Microsoft are not required in Ubuntu.

Robula

Posted 2014-03-28T20:43:51.940

Reputation: 1 180

2have the issue been fixed yet? I'm still suffer from it – zhangxaochen – 2016-08-02T07:42:45.817

He is correct yes, but how do we fix this? @Robula – Alex S – 2017-04-18T07:08:04.800

3There seems to be no fix for this issue - hyper-v seems to have no support for cut and paste between windows host OS and ubuntu 16 guest OS. This is unacceptable as a solution. Virtual box has this working out of the box... – John Little – 2018-01-23T16:37:04.407

1Wow this really sucks... – Niklas – 2018-05-03T11:04:17.947

2+1. Do you also have the problem with the Hyper-V Clipboard ? When I copy from Windows 8.1 simple text it just does not show in Ubuntu 14.04. For example the copied text "modules" from Windows shows as dddd or d or something else in Ubuntu running in Hyper-V. – Devid – 2014-04-07T12:27:52.357

2I can't copy and paste between host and guest either way using Ctrl+C and Ctrl+V. Did this functionality work on 13.10? – Robula – 2014-04-10T08:54:32.493

I think that the problem lies in the Enhanced Session Mode. Although I turned it on in the options it does not work with Ubuntu. I can use the copy functionality that is Capture Screen on the guest and paste it in the host machine, But i can't use the Type Clipboard text functionality that is copy simple text from host and paste it in guest machine. I think this didn't work in Ubuntu 13.10 too,but in 13.10 the mouse scroll wheel did not work also and now in Ubuntu 14.04 it works. The thing is when I copy text it is pasting something but it is not correct. Can we report this problem somewhere ? – Devid – 2014-04-10T11:51:41.887

Having a look over Google yielded no results regarding this issue, it appears to be an ongoing issue not just in Ubuntu but in (all?) a few Linux guests in Hyper-V. Could you not resort to using VNC Server to manage the guest? – Robula – 2014-04-10T12:11:25.703