Connect to Windows Server from Ubuntu under Hyper-V on Windows 10

I’m testing the “Hyper-V Quick Create” version of Ubuntu 18.04 under Windows 10 Pro joined to a Windows domain. Had some difficulty at first connecting to a share on a Windows 2016 server. A few notes:

On Windows 10, the Hyper-V Default Virtual Switch is set up as an Internal Network, meaning it will have a different IP range than your host network. However, it also automatically sets up NAT rules to all allow connection to the host network.

Hyper-V connect 1

DNS of the Ubuntu guest machine will point to the virtual switch, not to your domain controller.

Hyper-V connect 2

There is no suffix automatically appended to DNS queries. If you dig MyWinServer, the query fails. However dig MyWinServer.mydomain.local works.

In spite of that, if you try to mount a share using the MyWinServer.mydomain.local name, it will fail with the message “Unable to access location:  Failed to mount Windows share: Invalid argument.”

Hyper-V connect 3

I wound up using the IP address of the Windows server, in the format smb://

Hyper-V connect 4

You’ll know it’s working when you get this prompt:

Hyper-V connect 5

I found that the I could specify the Domain without the “.local” suffix.

Choosing Remember forever here adds the password to your default keyring (which will prompt for a new password if it’s the first time you’ve added a key). To edit or delete the password, open the Applications list, search for Passwords and Keys, then edit the Default keyring:

Hyper-V connect 6

To see the current NAT sessions, use PowerShell Get-NetNatSession on the Hyper-V host. Here we see a connection on port 80 to a Google Cloud server (although no browser is open in the guest) as well as the SMB connection on port 445 to my Windows server:

Hyper-V connect 7

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.

This site uses Akismet to reduce spam. Learn how your comment data is processed.