Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an Arch Linux install in a VirtualBox VM, and as I'm working all of a sudden, it will lose it's dynamic IP address.

When this happens, if I check on the status of the dhcpcd service it says it's running.

$ systemctl status dhcpcd.service
   Loaded: loaded (/usr/lib/systemd/system/dhcpcd.service: enabled)
   Active: active (running) since Sat 2013-09-28 20:10:32 EDT; 49min ago
 Main PID: 166 (dhcpcd)

I can try to restart the service, but it does not establish and IP .

$ sudo systemctl restart dhcpcd.service

    *No output is returned from the command

I can set an address manually, and it will work for a while, but then it'll drop again after a few minutes.

$ sudo ifconfig enp0s3 10.0.0.109 netmask 255.255.255.0 up
$ sudo route add default gw 10.0.0.1

I can also run dhcpcd manually, and it will successfully get an IP address, but again it will drop after a few minutes.

$ sudo dhcpcd enp0s3
dhcpcd[2580]: sending commands to master dhcpcd process

I have tried disabling dhcpcd.service and using dhcpcd@enp0s3.service, but it has the same results. Any ideas?

share|improve this question
    
You don't have another network manager running, do you? –  jasonwryan Sep 29 '13 at 1:28
    
@jasonwryan, no. –  druciferre Sep 29 '13 at 1:32
    
I'd use dhclient instead. I experienced lots of problems with dhcpcd on Gentoo lately. Probably they appeared after update, however it didn't work well until I changed the client app. –  webKnjaZ Oct 5 '13 at 0:47
    
dhcpcd on arch linux behaves a bit differently from other distros. For example, it spawns its own wpa_supplicant, and it probably does something similar for wired connections. I would look carefully at the source, I believe there is an argument you can pass to dhcpcd to make it behave normally –  pepper Jun 13 at 21:05
add comment

2 Answers

I just experienced the same problem and worked around it by installing an older version of dhcpcd. the latest version that seems to work is 5.6.8-1

Maybe try manually compiling the package? or disabling dhcpcd entirely and just configuring your vm ip statically.

share|improve this answer
add comment

if you want to have virtuliztion with virtualbox without DHCP, you should the following script for root and for username:

#!/bin/sh
VBoxManage hostonlyif ipconfig vboxnet0 --ip 172.16.5.5 --netmask 255.255.0.0
VBoxManage hostonlyif ipconfig vboxnet0 --ip 172.16.5.5 --netmask 255.255.0.0
VBoxManage dhcpserver remove --ifname vboxnet0
VBoxManage dhcpserver remove --ifname vboxnet1

Of course , you should change thsese parameters manaulay, or add ineterface or remove interface, because i don't know you how many have interface.

share|improve this answer
2  
I want to keep DCHP. The problem is it keeps losing its address every few minutes. –  druciferre Sep 29 '13 at 3:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.