I have configured CentOS VM, with NetworkManager disabled.


When I start VM I have access to the internet, but after a while I lose it. How can I fix that?

  • If additional info is needed, please, feel free to tell me, I'll do my best to get it and add to topic. – Denis Sablukov Mar 25 '19 at 12:06
  • Hey Denis, can you try to run traceroute to see where it's failing ! – Vivek Kanadiya Mar 25 '19 at 13:00
  • What version of CentOS are you using? – fpmurphy Mar 26 '19 at 2:36

in step one, you say:

When I start VM I have access to the internet, but after a while I lose it:

test this on console:

dhclient -v

You will notice it will bound IP address as shown below

[root@localhost network-scripts]# dhclient -v
Internet Systems Consortium DHCP Client 4.2.5 Copyright 2004-2013
Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/ens32/00:0c:29:68:22:e2
Sending on   LPF/ens32/00:0c:29:68:22:e2
Sending on   Socket/fallback DHCPDISCOVER on ens32 to port 67 interval 4 (xid=0x433a9e33) DHCPREQUEST on ens32 to port 67 (xid=0x433a9e33)
DHCPOFFER from DHCPACK from (xid=0x433a9e33) bound to -- renewal in 822 seconds.

then run this command to show your IP:

ip addr or ifconfig

then you should add to startup for auto/start : go to : cd /etc/init.d

create net-autostart file with sudo vim and save it:

# Solution for "Centos Connection from VMware"
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
dhclient -v

run command :

chmode +755 net-autostart

chconfig --add net-autostart

restart virtualbox

| improve this answer | |
  • The OP isn't using VMware. Well, according to the tags they're using virtualbox. – roaima Mar 25 '19 at 21:02
  • @roaima I don't think it is really matters in this case – Denis Sablukov Mar 25 '19 at 22:35
  • 1
    @farhad azim thanks, it seems to be working, but I'll wait a while to be sure. – Denis Sablukov Mar 25 '19 at 22:38
  • @DenisSablukov I couldn't work out what this solution is trying to fix, so I couldn't assume the VM environment was irrelevant. – roaima Mar 25 '19 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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