Workaround for Linux in Hyper-V cannot configure network addresses

Source: Internet
Author: User
Tags get ip

Met 2 times a week Linux is installed in Hyper-V 2012 and IC 3.4 is installed. However, the problem of IP address cannot be configured. So there is a lot of inconvenience, so find the opportunity to try this reason and solution.


Thanks to the tips of my colleagues in this process, I quickly find a solution.

Here's a summary of the considerations for installing Linux under Hyper-V:

1. Choose the Linux version correctly, please refer to the Compatibility List of the official website
2. When the installation is complete, be sure to install Linux IC 3.4
Mkdir/ic
Mount/dev/cdrom/mnt/cdrom (if unable to mount, first execute mkdir/mnt/cdrom)
Cp/mnt/cdrom/rhel6.3/ic (first confirm the copy of the IC version)
Switch to the/ic/rhel6.3 directory
Execution./install.sh
Wait for the installation to complete and execute: Reboot
Note: If you encounter permissions issues, use Chmod-r 777/ic to get Permissions

3. Use the IFCONFIG-A command in Linux to confirm that the NIC is correctly identified. You need to recognize a network card such as eth0 except for the LO network card)

By this time, Linux has recognized the virtual network card, if you still cannot configure the IP address, you need to do the manual creation of the configuration file steps:

The Linux NIC configuration file is divided into 2
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
If you do not have these two files in the development directory, you need to create them manually and create the following steps:

Vi/etc/sysconfig/network (although there is no such file, but can still be edited, editing is done after the switch to VI command line using WQ can be saved)
The contents of the configuration file are as follows:
Networking=yes
Hostname=linuxtest
gateway=192.168.1.254 by actual address)
After you create the network file, create the/etc/sysconfig/network-scripts/ifcfg-eth0eth0, and then modify it according to the contents of the ifconfig-a display.
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
The contents of this configuration file are as follows:
Device=eth0 according to the actual situation fill in)
Bootproto=static Get IP mode, automatic fetch is modified to DHCP)
ipaddr=192.168.1.140
netmask=255.255.255.0
gateway=192.168.1.1
Onboot=yes boot automatic activation)

After creation, use: Service network Restart restart the NIC service.

Ok! enjoy!

Workaround for Linux in Hyper-V cannot configure network addresses

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.