The original Ubuntu20.04 Server was installed on VirtualBox. After exporting the virtual host from VirtualBox to Hyper-V, the network cannot be networked. The reason is that the network card, network adapter and network connection have changed, and the network connection in Ubuntu needs to be reconfigured.
1. Check your network connection first
$ networkctl status -a
Select eth0, n/a, n/a, n/a
2. Go to the NetWork File
$ cd /run/systemd/network/
$ ll
We found that the old network file is 10-netplan-enp0s3.network, there is no new eth0 network card, we need to reconfigure the new network connection, Ubuntu 17.10 has been changed to netplan configuration network
3. Go to /etc/netplan/
$ cd /etc/netplan/
$ ll
4. Modify the 00-installer-config.yaml file
$ sudo vim 00-installer-config.yaml
Change enp0s3 to eth0
: wq save
5. Perform
$ sudo netplan apply
After successful execution
6. Also check the network connection
$ networkctl status -a
The system has successfully obtained the new IP, randomly ping a domain name, is normal access