[libvirt-users] How to start the linux container's network interface automatically

WANG Cheng D Cheng.d.Wang at alcatel-sbell.com.cn
Mon Jan 6 07:13:06 UTC 2014


Dear all,

I failed to start the linux container's network interface automatically. I have to start it manually each time after the container finishes booting.

I know that in a native fedora, if we want the network interface to start automatically, we should edit "/etc/sysconfig/network-script/ifcfg-eth0 and add the string "ONBOOT=yes".

My host is fedora 16. I used "yum --installroot=/root/fedoralxc --releasever=16 install -y openssh, bridge-utils" to setup the rootfs for my container (Laine thought that my fedora version is a little bit older, I wonder if the newer version fedora container can automatically start its network interface )

After rootfs installation, in the container's file system, there is no sub-directory named "network-scripts" in "/etc/sysconfig" . So, I created this directory manually and added a file named "ifcfg-eth0", but the container's network interface still cannot start automatically.

I tried to add files ".bash_profile" and ".bashrc" in which I added the "ifconfig" in the shell script to try to configure eth0 automatically, but it still doesn't work.

I wonder if there is a ".bashrc" for the root of a container? If there is, where should this file be located?

Any comments will be highly appreciated.

Cheng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20140106/33a0de01/attachment.htm>


More information about the libvirt-users mailing list