You are not logged in.

#1 2013-01-18 22:39:28

masm
Member
Registered: 2011-10-21
Posts: 8

[Solved] Failing to start dhcpcd@eth0 inside libvirt-lxc vm

What the subject says.

I was thinking that this could be some systemd 197 related problem. I've downgraded
to 196 and the problem remains. I have the latest version of all packages (linux, libvirt, etc.)

See the log below, please. Note that the there is a eth0 interface.

[arch@gitolite ~]$ ip link
12: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 02:00:00:00:00:17 brd ff:ff:ff:ff:ff:ff
14: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN mode DEFAULT
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

[arch@gitolite ~]$ sudo systemctl start dhcpcd@eth0
A dependency job for dhcpcd@eth0.service failed. See 'journalctl -xn' for details.

[arch@gitolite ~]$ sudo journalctl -xn
-- Logs begin at Fri, 2013-01-18 18:32:42 UTC, end at Fri, 2013-01-18 22:32:09 U
Jan 18 22:29:58 gitolite sudo[45]: pam_unix(sudo:session): session opened for us
Jan 18 22:29:58 gitolite systemd[1]: Expecting device sys-subsystem-net-devices-
-- Subject: Unit sys-subsystem-net-devices-eth0.device has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/7d495
--
-- Unit sys-subsystem-net-devices-eth0.device has begun starting up.
Jan 18 22:31:28 gitolite systemd[1]: Job sys-subsystem-net-devices-eth0.device/s
Jan 18 22:31:28 gitolite systemd[1]: Timed out waiting for device sys-subsystem-
-- Subject: Unit sys-subsystem-net-devices-eth0.device has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02c
--
-- Unit sys-subsystem-net-devices-eth0.device has failed.
--
-- The result is timeout.
Jan 18 22:31:28 gitolite systemd[1]: Dependency failed for dhcpcd on eth0.
-- Subject: Unit dhcpcd@eth0.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02c
--
-- Unit dhcpcd@eth0.service has failed.
--
-- The result is dependency.
Jan 18 22:31:28 gitolite systemd[1]: Job dhcpcd@eth0.service/start failed with r
Jan 18 22:31:28 gitolite systemd[1]: Job sys-subsystem-net-devices-eth0.device/s
Jan 18 22:31:28 gitolite sudo[45]: pam_unix(sudo:session): session closed for us
Jan 18 22:32:09 gitolite sudo[48]: arch : TTY=console ; PWD=/home/arch ; USER=ro
Jan 18 22:32:09 gitolite sudo[48]: pam_unix(sudo:session): session opened for us

libvirt configuration is simple:

<domain type='lxc'>
  <name>gitolite</name>
  <uuid>3122bf1d-11bb-0dd8-be64-7e352b3f8694</uuid>
  <memory unit='KiB'>262144</memory>
  <currentMemory unit='KiB'>262144</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64'>exe</type>
    <init>/sbin/init</init>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/lib/libvirt/libvirt_lxc</emulator>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/mnt/gitolite'/>
      <target dir='/'/>
    </filesystem>
    <interface type='network'>
      <mac address='02:00:00:00:00:17'/>
      <source network='default'/>
    </interface>
    <console type='pty'>
      <target type='lxc' port='0'/>
    </console>
  </devices>
</domain>

Can anyone help, please?

Last edited by masm (2013-01-25 21:12:30)

Offline

#2 2013-01-19 14:36:34

masm
Member
Registered: 2011-10-21
Posts: 8

Re: [Solved] Failing to start dhcpcd@eth0 inside libvirt-lxc vm

I'm trying to get this running without using systemd.

I restart the domain, and do

# ip link set eth0 up

# ip link show eth0
14: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 02:00:00:00:00:17 brd ff:ff:ff:ff:ff:ff

# dhcpcd eth0
dhcpcd[44]: version 5.6.4 starting
dhcpcd[44]: eth0: if_init: Read-only file system
dhcpcd[44]: eth0: interface not found or invalid

What does this mean? I googled for it, but didn'g find anything
In the guest, the only filesystem marked as read-only is /sys.
Any idea?

Offline

#3 2013-01-25 21:12:07

masm
Member
Registered: 2011-10-21
Posts: 8

Re: [Solved] Failing to start dhcpcd@eth0 inside libvirt-lxc vm

dhcpcd does not work because it tries to write to the /proc/sys file system. I now use dhclient instead as that works.

Offline

#4 2013-02-01 14:29:29

larsks
Member
Registered: 2013-02-01
Posts: 1

Re: [Solved] Failing to start dhcpcd@eth0 inside libvirt-lxc vm

For the record: it is possible to get dhcpcd to run inside an LXC container.  I've written up some instructions here.  The short answer is that you can use "bind" mounts to mask the appropriate sysctl entries under /proc.

Offline

#5 2013-09-08 03:01:37

bkg6891
Member
Registered: 2013-09-08
Posts: 1

Re: [Solved] Failing to start dhcpcd@eth0 inside libvirt-lxc vm

This worked for me 'sudo systemctl enable dhcpcd.service'. It seems like there was a change in systemctl that required this modification in the command.

Offline

Board footer

Powered by FluxBB