Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Just installed Hyper-V on Windows 8 and Guest OS Ubuntu 12.04.

Coming from VirtualBox, I am looking for best method for sharing a Directory on Host/Windows with Guest Ubuntu.

I read this: http://stackoverflow.com/a/1386764/913295 and I am familiar with Samba. Since that question does not relate to Hyper-V I am raising this related question here.

share|improve this question
add comment

migrated from stackoverflow.com Jan 11 '13 at 14:57

This question came from our site for professional and enthusiast programmers.

1 Answer

Good question.

The bad news is that, unlike VirtualBox or VMWare that allows you to define "Shared Folders" which are directories on your host that are exposed to the guest, Windows 8 Hyper-V does not provide such feature at all.

The good news is that, since there is not such feature provided out of box from Hyper-V at all, there won't be necessary special purposed tools for it, e.g., for mounting vboxsf file systems. You just going through the official/standard way, accessing your host share folders as network shared folders.

The smbclient, the command-line SMB/CIFS clients for Unix, is the command-line tool to access to your Windows host share folders. Below are two examples that I found. Again, nothing special, access it the same way as you access any other Windows network shared folders.

How can I connect from Ubuntu 12.10 to file shares on a Windows 8 system
http://askubuntu.com/questions/245106/how-can-i-connect-from-ubuntu-12-10-to-file-shares-on-a-windows-8-system-using-a

Perfect Ubuntu setup on Hyper-V in Windows 8
http://webdevtooling.com/webdevtooling.com/tutorials/perfect-ubuntu-setup-on-hyper-v-in-windows-8/

I'll repost the "Configure a shared folder" section from the second link:

We need to share out a folder in the host to the guest. Guest can mount this on boot. For this tutorial, I’ll assume we are sharing it from a this location %USERPROFILE%\workspace

In the VM, edit the /etc/fstab:

//WinHost/users/username/workspace /home/username/workspace  cifs    defaults,soft,uid=username,gid=users,file_mode=0777,dir_mode=0777,credentials=/home/username/.cifs-credentials,soft

Also, add a credentials file for the mount to work. Put the following content in there:

username=[email protected]
password=something

That should be it.

More references for GUI based mounting:

http://www.wikihow.com/Mount-a-Windows-Share-on-an-Ubuntu-Server
http://www.liberiangeek.net/2013/04/how-to-access-windows-network-shares-in-ubuntu-13-04-raring-ringtail/
http://www.7tutorials.com/how-access-windows-7-shared-folders-ubuntu
https://help.ubuntu.com/community/MountWindowsSharesPermanently

If it doesn't work for you at first, try with a Windows based client first to access the host share folders. Again, nothing special, access it the same way as you access any other Windows network shared folders. I.e., some how-tos says that you "must have Created Internal Virtual Switch Via Virtual Switch Manager" to use the host share, that is purely not necessary and it gives you no benefits/advantages at all, since we are just accessing it as a normal Windows network shared folder. To recap, here are the steps:

  1. On your Hyper-V host, create a shared folder and assign Change permission to Everyone.

  2. On the virtual machine running on the host, open the Network and Sharing Center and enable File and Printer Sharing.

  3. On the virtual machine, click Start and type \\host_name\share_name where host_name is the name of your Hyper-V host and share_name is the name of the share you created.

  4. Press ENTER and an Explorer window will open in the VM showing the contents of the shared folder on the host.

  5. You can now copy files from the VM to the host and vice versa as needed.

References:

http://stackoverflow.com/questions/1386754/edit-source-directly-on-ubuntu-vm-from-windows-host/1386764#1386764

How to share files between a Hyper-V host and its virtual machines
http://www.windowsnetworking.com/kbase/WindowsTips/WindowsServer2008/AdminTips/VirtualPlatforms/HowtosharefilesbetweenaHyper-Vhostanditsvirtualmachines.html

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.