Hyper-V virtual machine under Ubuntu Server 14.04 Configuration Network

Source: Internet
Author: User
Tags ssh filezilla

Settings in Hyper-V

1. Go to Virtual Switch Manager

2. Create a new network virtual switch, the connection type is external network, select a network card

(I bought a USB card for the virtual machine to surf the internet, the motherboard comes with a network card for physical machine Internet access)

3. Set the virtual machine's network adapter to the newly created virtual switch

4. Start the virtual machine


Ubuntu Server Settings

1. Check if Hyper-V IC module is enabled

Lsmod|grep Hv_vmbus

If enabled there will be the following display

Hv_vmbus 65536 7 HV_BALLOON,HYPERV_KEYBOARD,HV_NETVSC,HID_HYPERV,HV_UTILS,HYPERV_FB,HV_STORVSC


2. If not, your Ubuntu version may be lower and need to be edited/etc/initramfs-tools/modules

Vi/etc/initramfs-tools/modules after appending
hv_vmbus
hv_storvsc
hv_blkvsc
hv_netvsc

after append save
Press ESC
: Wq

after saving, run Update-initramfs, and reboot the system
sudo update-initramfs–u
sudo reboot

3. Configure the NIC IP address, vi/etc/network/interfaces, add the following code

Static address mode (recommended)

#根据你的实际网路环境设置
auto eth0 
iface eth0 inet static
address 192.168.1.122 
netmask 255.255.255.0
Network 192.168.1.0
broadcast 192.168.1.255
Gateway 192.168.1.1
dns-nameservers 8.8.8.8

Dynamic Address mode
Auto eth0
iface eth0 inet DHCP


4. Set dns,vi/etc/resolv.conf, add

NameServer 8.8.8.8


5. Entry into force

sudo/etc/init.d/networking Restart
reboot



6. Testing

Ping www.baidu.com

or

wget http://www.baidu.com


You can connect to an extranet at this point, or you can connect to Ubuntu with tools such as FileZilla (SSH service is typically installed)

Use FileZilla to access Ubuntu, if you use the root account, you need to modify the vi/etc/ssh/sshd_config, otherwise there will be "authentication failed"

Locate the Permitrootlogin:withpassword
change to
Permitrootlogin:yes after saving and restart the

SSH Services service
ssh restart






Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.