How to recover network
Posted: Mon Aug 26, 2019 11:54 am
Linux version: Ubuntu 16.04 server amd64, VirtualBox VM
Occasionally network access stopped to work on the server.
Command ifconfig gives only lo interface.
First attempt was to change network adapter in VM settings.
I even changed MAC and added an extra network adapter.
No result yet
It looks there was some problem with network drivers.
No Internet connection.
When I need to fix something in Windows and nothing works, I normally get Windows installer (CD .. or even USB stick).
I goggled possibility to do similar things using Linux live CD.
"The easiest way is boot from an installation media and then use chroot" (https://askubuntu.com/questions/319798/ ... -on-ubuntu)
And I found good explanation on that:
http://ubuntu.fliplinux.com/1836.html (Russian) - exactly related to the subject
https://help.ubuntu.com/community/LiveCdRecovery (English)
The idea was to re-install network manager
In case of having Internet connection, it would be done in the following way
Without Internet (network does not work), I needed to get Ubuntu 16.4 iso image. Old Gitlab server has the same version.
When I boot from Live CD, I found single HDD and its main partition as /dev/sda1.
In terminal window I executed the following commands
Now further installations will be applied to real HDD, and not to live (temp) system
Internet connection works on the Live (temp) system First I had to install latest updates to current Ubuntu 16.4
sudo apt-get upgrade (desired... but probably not really necessary)
Upgrade may take a while since more than 1 Gbytes should be downloaded and installed.
Then network manager can be (re)installed
This command did not work. There was error message with recommendation to execute 'sudo dpkg --configure -a'
After that command (executed for a while), I tried to install network manager again
I restarted the server without Live CD. And it appeared network is working!!!
Normally I install Midnight Commander (mc). I like GUI. And that allows me to browse files easily.
That is all.
Occasionally network access stopped to work on the server.
Command ifconfig gives only lo interface.
First attempt was to change network adapter in VM settings.
I even changed MAC and added an extra network adapter.
No result yet
It looks there was some problem with network drivers.
No Internet connection.
When I need to fix something in Windows and nothing works, I normally get Windows installer (CD .. or even USB stick).
I goggled possibility to do similar things using Linux live CD.
"The easiest way is boot from an installation media and then use chroot" (https://askubuntu.com/questions/319798/ ... -on-ubuntu)
And I found good explanation on that:
http://ubuntu.fliplinux.com/1836.html (Russian) - exactly related to the subject
https://help.ubuntu.com/community/LiveCdRecovery (English)
The idea was to re-install network manager
In case of having Internet connection, it would be done in the following way
Code: Select all
sudo apt-get install network-managerWhen I boot from Live CD, I found single HDD and its main partition as /dev/sda1.
In terminal window I executed the following commands
Code: Select all
sudo mount /dev/sda1 /mnt
sudo mount --bind /sys /mnt/sys
sudo mount --bind /proc /mnt/proc
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo cp /etc/resolv.conf /mnt/etc/
sudo chroot /mntInternet connection works on the Live (temp) system First I had to install latest updates to current Ubuntu 16.4
Code: Select all
sudo apt-get updateUpgrade may take a while since more than 1 Gbytes should be downloaded and installed.
Then network manager can be (re)installed
Code: Select all
sudo apt-get install network-managerAfter that command (executed for a while), I tried to install network manager again
Code: Select all
sudo dpkg --configure -aCode: Select all
sudo apt-get install network-managerNormally I install Midnight Commander (mc). I like GUI. And that allows me to browse files easily.
Code: Select all
sudo apt-get install mc