I have Ubuntu latest server edition installed as VM on Hyper-V.

I get the command line, but need to install GUI desktop for which i need to have network available on ubuntu.

From the Hyper-V VM console, it shows that my Virtual network is configured for the VM, but from LinuxVM cmd-line unable to ping.

I have 1 NIC with LAN and static IPs available on the Host Windows 2008 R2 Server.

My question is how to configure network (LAN or static IP) on Ubuntu VM ?


Make sure you use the legacy network adapter for the guest, as there's no drivers for the normal one in Linux. In order to use multiple processors, you need to install the hyper-v guest tools too.

When done, rebooted and confirmed you found a nic in Linux; open /etc/network/interfaces and modify accordingly.

auto eth0
iface eth0 inet static
address ip_goes_here
netmask netmask_goes_here
broadcast bcast_goes_here
gateway gateway_goes_here
Don't forget to add a nameserver in /etc/resolv.conf. If you did it correctly, you should be able to bring the interface up using 'ifup eth0'.

  • Ok cool. I tried to open this file in vi. its weird, unable to edit, or give space/delete and some other characters. its making me nuts. I am able to type all characters on cmdline, so its no probs with keyboard (was detected correctly as us) – Munish Goyal Jan 25 '11 at 8:25
  • 1
    You are probably not familiar with vi. Try using nano instead. – sybreon Jan 25 '11 at 11:47

Check first your nic got detected, with ifconfig or dmesg, something like:

root@mercurio:~# dmesg|grep eth0
[    3.578197] 0000:00:19.0: eth0: (PCI Express:2.5GB/s:Width x1) 00:22:4d:37:51:ba
[    3.578200] 0000:00:19.0: eth0: Intel(R) PRO/1000 Network Connection
[    3.578241] 0000:00:19.0: eth0: MAC: 9, PHY: 9, PBA No: 313130-032


root@mercurio:~# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:22:4d:37:51:ba  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

If detected, you can begin to work with a "dhclient eth0", that will give you an address via a DHCP and lets you begin to install software via apt-get / aptitude. Then you can edit your interface files as 3molo says.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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