Geeks With Blogs

News

Disclaimer


Posts in the blog are provided "AS IS" with no warranties implied or expressed. The opinions expressed here are mine alone, and may not represent those of any organization or group that I am part of.
Manesh Karunakaran

For those who are familiar with the VirtualPC, vmWare and VirtualBox environments will be quite irritated to find out, in Hyper-V, there is no direct way to share files from the Host machine to the Virtualized guest environment. This is a good thing from a CIO perspective because there’s excellent isolation for the virtualized environments this way, but for the developer junkies like us, this is an irritant, especially for those who have nuked their Windows 7 OS and installed Windows Server 2008 R2 for all the the SharePoint friendliness that it offers. Here’s a quick 5 minutes howto on Enabling Shared Folders and Internet Access for the Hyper-V images, for those who are still struggling with this.

Step 1: Add a Virtual Network Adapter to your Guest OS

For this, shut down the guest machine, go to its settings and add a Virtual Network Adapter as given in the images below

settings

 

AddNetworkAdapter

 

AddNetworkAdapter-Settings

Step 2: Enable Virtual Networking in Hyper-V  

Setting this up is very easy.

  1. In the Hyper-V Manager, under Actions (right panel), click the Virtual Network Manager.
  2. In the Virtual Network Manager in the Create virtual network panel, select Internal and click the Add button.

EnableVirtualNetworking

 

Internal-Add

 

VirtualNetworkConfig  

At this point if you open Control Panel\Network and Internet\Network Connections you will be able to see the new Network Adapter, Now name it to something meaningful other than Network Adapter X. Now you can add this network to each of your virtual machines, but at this point, unless you assign an IP address in each connection, you won't be able to do much.

 

Step 3: Enable Internet Connection Sharing so that Guest OS’es also can connect to the internet.

To enable ICS follow these steps:

  1. Click on the network icon in the tray of your host machine and select Network and Sharing Center.
  2. From there click Manage network connections.
  3. Select the network adapter that you use to access the Internet. Right click it and select Properties.
  4. In the properties dialog select the Sharing tab.
  5. On this tab check the box that says "Allow other network users..." and then set the Home networking connection to be the network adapter that was created above (now you see why I said to rename it to something useful).

ICS


Now your virtual machines that have this network connection will automatically get an IP address and will be able to connect to the Internet (provided your internet connection is working).

Because each adapter also gets an automatic address you can now share files and folders between your host and your virtual machines which is important since you can't just drag-and-drop files like you can with Virtual PC.

 

Step 4: Create a Shared Folder in the Host Machine and use it in the Guest machine.

  1. Right click on the folder that you want to Share and select ‘Share with\Specific People’ and specify who all can access the share.
  2. Open the Guest OS from Hyper V
  3. Navigate to Start > Run and type in the Address of the Share (Or Map a Drive to the Share)
  4. Bingo! The Share opens!! :)

Share

 

Shared


Now you can share as many files and folders as you want between the host and the guest, and you also have internet access inside the Virtual machines. Hope that helps.

 

Posted on Wednesday, May 26, 2010 10:20 AM | Back to top


Comments on this post: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
Dude it worked bingo!!!!
Spen almost 3 days before i found this...... Thanks a lot!!!


Left by shravan on Sep 02, 2010 1:23 AM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
Great work around, but do you know why any file transfers I do with this, or by using a network shared folder only has speeds of 6megs per second?
Left by Colby on Sep 09, 2010 11:39 PM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
Great work, thanks
Left by Bramley on Nov 05, 2010 4:22 AM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
Good Post Manesh. I thought of writing this as separate article! :)
Left by Venkatesh on Nov 19, 2010 2:56 PM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
well done Mr. :))
Left by melih on Dec 23, 2010 1:01 PM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
I cannot beleive it. I have been looking for this for around 6 hours now and I finally found this article and got it to work. Thanks a lot!!!!
Left by Chris on Jan 24, 2011 7:50 PM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
This was really helpful. Thanks a ton. Aprreciated.
Left by Ajay on Jan 02, 2012 4:07 PM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
I am very use to Vmware workstation and I was pulling my hair out. Nice blog
Thank You
Left by Charles on May 02, 2012 5:13 AM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
Very helpful, thanks.
Left by santosh on Oct 21, 2012 1:23 AM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
Hi, I tried the steps but when I tried to connect, it is asking me for a username and password. I tried the Administrator of the host and the guest server, none of them work. Also, the server where I have my Hyper-V set up does not have any internet connection
Left by Ashley on Oct 30, 2012 9:08 PM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
Thanks! It is exactly what I need, you saved me a lot of time! I've also been asked for login/password. Creating new user/password in host system was helpful.
Left by Shusha on Nov 05, 2012 5:31 PM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
The only way to mount a local file share from the host to the guest is...not to do that at all? But instead - to expose the guest VMs to a network?

Pretty lame.

Instead. I took my files on server core, ISO'ed 'em up and shared that way. Easy to create an ISO :)

That way for test lab you don't have to expose guest OS to big bad enclave (or worse - public) network.
Left by Anj on Nov 19, 2012 5:12 AM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
Hi!

Thanks for the help I just have one little problem... When I create a new network connection it will only give me the "Not Connected" option, how can I Fix that?

Greetings
Left by Shaula Montoya on Jan 28, 2013 5:13 AM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
worked like a charm....
Left by myhelper292 on Jun 04, 2013 8:18 PM

# re: Share Files and Folders and Internet between Guest OS and the Host in Hyper-V
Requesting Gravatar...
Wow... followed it heartily and it worked exactly as promised! Worth every penny!!!
Left by huikhava on Nov 28, 2013 11:33 PM

Your comment:
 (will show your gravatar)
 


Copyright © Manesh Karunakaran | Powered by: GeeksWithBlogs.net | Join free