Score:0

Ubuntu Server 20.04 network config

tr flag

I have Ubuntu Server 20.04 installed in virtual machine on my Windows Hyper-V host.
I'd like it to get IP address from my Windows DHCP-server in local network But it doesn't work and I don't know why. Virtual machine with Windows with same configuration works fine.

ip a output:

1: lo: <L00PBACK,UP,L0WER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
 inet 127.0.0.1/8 scope host lo
    valid.lft forever preferred.lft forever
 inet6 ::1/128 scope host
    valid.lft forever preferred.lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
 link/ether 00:15:5d:00:28:18 brd ff:ff:ff:ff:ff:ff
 inet6 fe80::215:5dff:fe00:2818/64 scope link
    valid.lft forever preferred.lft forever

Content of /etc/netplan/00-installer-config.yaml:

network:
  ethernets:
    eth0:
      dhcp4: true
  version: 2

Output of sudo netplan --debug generate

DEBUG:command generate: running ['/lib/netplan/generate']
** (generate:1818): DEBUG: 12:50:00.358: Processing input file /etc/netplan/00-installer-config.yaml..
** (generate:1818): DEBUG: 12:50:00.359: starting new processing pass
** (generate:1818): DEBUG: 12:50:00.360: We have some netdefs, pass them through a final round of validation
** (generate:1818): DEBUG: 12:50:00.360: eth0: setting default backend to 1
** (generate:1818): DEBUG: 12:50:00.361: Configuration is valid
** (generate:1818): DEBUG: 12:50:00.361: Generating output files..
** (generate:1818): DEBUG: 12:50:00.362: openvswitch: definition eth0 is not for us (backend 1)
** (generate:1818): DEBUG: 12:50:00.363: NetworkManager: definition eth0 is not for us (backend 1)
(generate:1818): GLib-DEBUG: 12:50:00.363: posix_spawn avoided (fd close requested)
(generate:1818): GLib-DEBUG: 12:50:00.365: posix_spawn avoided (fd close requested)

Output of sudo netplan --debug apply

** (generate:1826): DEBUG: 12:53:09.513: Processing input file /etc/netplan/00-installer-config.yaml..
** (generate:1826): DEBUG: 12:53:09.514: starting new processing pass
** (generate:1826): DEBUG: 12:53:09.515: He have some netdefs, pass them through a final round of validation
** (generate:1826): DEBUG: 12:53:09.516: eth0: setting default backend to 1
** (generate:1826): DEBUG: 12:53:09.517: Configuration is valid
** (generate:1826): DEBUG: 12:53:09.518: Generating output files..
** (generate:1826): DEBUG: 12:53:09.519: openvswitch: definition eth0 is not for us (backend 1)
** (generate:1826): DEBUG: 12:53:09.520: NetworkManager: definition eth0 is not for us (backend 1)
(generate:1826): GLib-DEBUG: 12:53:09.521: posix_spawn avoided (fd close requested)
(generate:1826): GLib-DEBUG: 12:53:09.523: posix_spawn avoided (fd close requested)
DEBUG:netplan generated networkd configuration changed, restarting networkd
DEBUG:eth0 not found in {}
DEBUG:Merged config:
network:
  ethernets:
    eth0:
      dhcp4: true
  version: 2
  
DEBUG:no netplan generated NM configuration exists
DEBUG:eth0 not found in {}
DEBUG:Merged config:
network:
  ethernets:
    eth0:
      dhcp4: true
  version: 2
  
DEBUG:Link changes: {}
DEBUG:netplan triggering .link rules for lo
DEBUG:netplan triggering .link rules for eth0
DEBUG:eth0 not found in {}
DEBUG:Merged config:
network:
  ethernets:
    eth0:
      dhcp4: true
  version: 2

cat /etc/network/interfaces output

cat: /etc/network/interfaces/: No such file or directory

ls -al /etc/netplan output

total 12
drwxr-xr-x 2    root    root    4096    Nov 26  14:01
drwxr-xr-x 106  root    root    4096    Nov 25  16:45
-rw-r--r-— 1    root    root    115     Nov 26  14:01   00-installer-config.yaml

cat /etc/netplan/*.yaml output

# This is the network config written by 'subiquity'
network:
  ethernets:
    eth0:
      dhcp4: true
  version: 2

sudo lshw -C network output

[77792.441265] blk_update_request: I/O error, dev sr0, sector 0 op 0x0: (READ) flags 0x80700 phys_seg 4 prio class 0     
[77792.442325] blk_update_request: I/O error, dev sr0, sector 0 op 0x0: (READ) flags 0x0 phys_seg 1 prio class 0
[77792.443250] Buffer I/O error on dev sr0, logical block 0, async page read       
[77792.444154] blk_update_request: I/O error, dev sr0, sector 1 op 0x0: (READ) flags 0x0 phys_seg 1 prio class 0
[77792.445145] Buffer I/O error on dev sr0, logical block 1, async page read       
[77792.446145] blk_update_request: I/O error, dev sr0, sector 2 op 0x0: (READ) flags 0x0 phys_seg 1 prio class 0
[77792.447102] Buffer I/O error on dev sr0, logical block 2, async page read       
[77792.448088] blk_update_request: I/O error, dev sr0, sector 3 op 0x0: (READ) flags 0x0 phys_seg 1 prio class 0
[77792.449085] Buffer I/O error on dev sr0, logical block 3, async page read       
[77792.450098] blk_update_request: I/O error, dev sr0, sector 4 op 0x0: (READ) flags 0x0 phys_seg 1 prio class 0
[77792.451058] Buffer I/O error on dev sr0, logical block 4, async page read       
[77792.452411] blk_update_request: I/O error, dev sr0, sector 5 op 0x0: (READ) flags 0x0 phys_seg 1 prio class 0
[77792.453448] Buffer I/O error on dev sr0, logical block 5, async page read       
[77792.454518] blk_update_request: I/O error, dev sr0, sector 6 op 0x0: (READ) flags 0x0 phys_seg 1 prio class 0
[77792.455569] Buffer I/O error on dev sr0, logical block 6, async page read       
[77792.456646] blk_update_request: I/O error, dev sr0, sector 7 op 0x0: (READ) flags 0x0 phys_seg 1 prio class 0
[77792.457762] Buffer I/O error on dev sr0, logical block 7, async page read       
[77792.458901] blk_update_request: I/O error, dev sr0, sector 0 op 0x0: (READ) flags 0x0 phys_seg 1 prio class 0
[77792.460028] Buffer I/O error on dev sr0, logical block 0, async page read       
[77792.461166] Buffer I/O error on dev sr0, logical block 1, async page read       
    *-network
        description: Ethernet interface
        physical id: 1
        logical name: eth0
        serial: 00:15:5d:00:28:18
        size: 1Gbit/s
        capabilities: ethernet physical
        configuration: autonegotiation=off broadcast=yes driver=hv_netvsc duplex=full firmware=N/A link=yes multicast=yes speed=lGbit/s
heynnema avatar
ru flag
Edit your question and show me `cat /etc/network/interfaces` and `ls -al /etc/netplan` and `cat /etc/netplan/*.yaml` and `sudo lshw -C network`. Start comments to me with @heynnema or I'll miss them.
heynnema avatar
ru flag
@user535733 networkd is used for servers, not NetworkManager.
Nickolay Khalaychidi avatar
tr flag
@heynnema question was edited as you asked
heynnema avatar
ru flag
Everything looks ok there. There may be a problem with your Windows Hyper-V host setup. Check if it's in bridged mode. Also, do you have a CD/DVD inserted in your sr0 drive... as it's reporting a number of errors. Bad disc or bad drive?
Nickolay Khalaychidi avatar
tr flag
@heynnema Hyper-V host setup looks fine and my windows vm's are working good. Also, when I change '00-installer-config.yam' to use static IP, it works on Ubuntu too... There was no image in sr0 drive, so I removed it from configuration. There is no more I/O errors, but it didn't make affect to network problem
heynnema avatar
ru flag
Everything you've put into your question looks fine. I don't know what's wrong with your configuration. Please keep me posted if you find a solution.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.