Installing and configuring Ubuntu network installation in Hyper-V 1. to install Ubuntu in Hyper-V, follow these steps to install Ubuntu Server 2. after the installation is complete, edit the file # sudo vi/etc/initramfs-tools/modules in Ubuntu and add the configuration line hv_vmbus hv_storvsc hv_blkvsc hv_netvsc 3 at the end of the file. run update-initramfs and reboot system # update-initramfs-u # reboot 4. the Hyper-v ic is enabled after the UT is started again. You can use the lsmod command for verification: # lsmod | grep hv_vmbus 50431 4 hv_utils, hv_netvsc, hv_blkvsc, hv_storvsc 5. set the IP address, gateway, and mask. Sudo vi/etc/network/interfaces, add the following content: use static IP (recommended): iface eth0 inet static address 192.168.1.200 netmask 255.255.255.0 gateway 192.168.1.1 auto eth0 use DHCP: auto eth0 iface eth0 inet dhcp 6. add DNS: vi/etc/resolv. conf (may be created), add the following content: # Add the Domain Name Server nameserver 192.168.1.1/etc/resolv. the conf file will be generated again after it is restarted, and previous modifications will be lost, so # sudo vi/etc/resolvconf/resolv. conf. d/tail then add the DNS in this file, in the same format as the previous/etc/resolv. conf file consistency: nameserver 192.168.1.1, enter wq to save and exit, and restart resolvconf to make the configuration take effect: #/etc/init. d/resolvconf restart 7. restart the network: # sudo/etc/init. d/networking restart if an error is reported in this step, RTNETLINK answers: File exists Failed to bring up ethX may need to be executed first: # sudo iptables-save. In addition, pay attention to the network configuration, you can modify the network configuration in the upper-right corner. static IP configuration is recommended.