Setting up ArchLinux in Hyper-V - no ethernet

3

1

I'm a complete beginner to Linux and want to learn the environment. While trying to install Arch-Linux on a Hyper-V box using this tutorial, I hit an early obstacle with Ethernet: it doesn't seem to exist. ping -c 3 8.8.8.8 gives me an error along the lines of "cannot connect". The VM's network adapter is Intel Centrino Advanced-N 6235 Virtual Switch. How can I get this to work? Should I look into another distro first?

detectivecalcite

Posted 2013-12-17T21:49:07.073

Reputation: 31

1Just a few comments. 1) Arch is difficult, if you are a beginner. It might be wise to use another distro, or problems like this will take up so much of your time. 2) Arch does not install well on Hyper-V, why don't you try VMWare or VirtualBox, for which the Arch Wiki has detailed instructions? 3) The Arch Wiki for installation on bare metal is particularly well-written, I strongly suggest you use that guide. – MariusMatutiae – 2013-12-18T12:27:35.380

Thanks. What would a good first linux distro be? – detectivecalcite – 2013-12-19T02:05:55.797

1A good first distro is Ubuntu. It installs all by itself, has enormous number of extra applications in the repositories which will help you do everything you wish. From there you can start exploring. A year from now, you will want to switch to Arch. – MariusMatutiae – 2013-12-19T05:05:18.380

Answers

1

You should switch the Hyper-V VM to use a "legacy" network card, because there are often problems with the Kernel Modules (i.e. Device Drivers) to use Hyper-V's default network card.

Here's how to do it:

  1. With the virtual machine turned off, open its "Settings" (either from Hyper-V manager, or from the VM Window)
  2. In the "Hardware" list, click the existing network adapter, note its settings, and then click "Remove"
  3. In the "Hardware" list, click "Add Hardware" at the top, then choose "Legacy Network Adapter" and click "Add"
  4. Configure the new adapter with the settings you noted from the old one.
  5. Save your changes and start the VM.

Moshe Katz

Posted 2013-12-17T21:49:07.073

Reputation: 2 706

By "Hyper-V's default network card", do you mean kernel/drivers/net/hyperv/hv_netvsc.ko ("description: Microsoft Hyper-V network driver")? – user1686 – 2013-12-17T22:18:10.200

@grawity Yes. But I have found that it often doesn't work. – Moshe Katz – 2013-12-17T22:21:08.743

0

Hyper-V VMs don't have any network connectivity by default. You have to create a Virtual Network Switch on the VM host (the Windows computer) to let the VM share internet with the host.

To do this, open Hyper-V Manager.

  1. In the Actions Pane on the right, click the link for "Virtual Switch Manager".
  2. If you want your VM to be able to access the internet, you want to create an External Virtual Switch.
  3. In the Virtual Switch Manager dialog, click "New Virtual Switch" in the pane on the left, at the top, and then select "External" in the list and click the "Create Virtual Switch" button.
  4. Now, the main panel in the Virtual Switch Manager dialog will have changed to your newly created virtual switch.
  5. Make sure the "External Network" radio button is selected.
  6. In the drop down below the "External Network" radio button, select the physical network interface your host computer uses. If your host has more than one network interface, make sure to select the one that is connected to the internet. Name your Virtual Switch something you'll recognize.
  7. THIS IS VERY IMPORTANT Check the box that says "Allow management operating system to share this network adapter". This allows your VM host to share the network switch with the VMs hosted on it. If this is not checked, your VM host will lose internet connectivity when you click "Ok".
  8. Click "Apply". NOTE: You will lose any internet connections for a few seconds when you do this. This is because Windows is creating the Virtual Network Switch device, and then adding the Windows computer to the Switch.
  9. Click "Ok" on the Virtual Switch Manager Dialog.
  10. With your Arch Linux VM in the "Off" state, select it from the Hyper-V Manager window, and click the "Settings" link in the right pane.
  11. In the settings dialog, select the network adapter from the Hardware list on the left.
  12. In the main pane, in the drop-down list labelled "Virtual Switch", change it from "Not Connected" to the name of the Virtual Switch you picked in Step 6.
  13. Click "Ok".

Now you can start up your Arch VM and it will have network connectivity.

In a general rule, whenever creating a Hyper-V VM, you will need to connect it to a Virtual Switch if you want it to have network connectivity.

Anro

Posted 2013-12-17T21:49:07.073

Reputation: 127

I lose my host internet connection when using the bridged connection (I five-double checked the "allow sharing" checkbox in your step 7). Do you have any idea why this might be? – rubenvb – 2015-06-27T11:51:00.390

@rubenvb That's pretty strange. Do you have any other Virtual Switches? You may want to check to make sure that you're getting a Virtual NIC in the host OS after you create the Virtual Switch. You can do this by opening command prompt and typing ipconfig /all and making sure you see an adapter connected to your new Virtual Switch. If it doesn't get created, try PM'ing me. – Anro – 2015-12-02T07:48:57.543