Ubuntu 20.04 random freeze

vamp

Active Member
Jun 24, 2017
19
2
43
37
Hello there,


About 2 weeks ago, my Ubuntu VM (it runs years ago) is randomly freeze. It only help the hard reset on the VM. I try to check all logs (VM and Host), but not see any problem.


If the VM is freeze, the console is not working, no ssh, and 1 one the 4 cores is maxed.... The other VM at the same host is work well.

I dont know what the way that i try to figure out what is the problem, if no log error or anything that help me...
 
Hi,

Please post output of PVE version pveversion -v and config of the Ubuntu VM

Bash:
root@pve:~# pveversion -v
proxmox-ve: 6.2-1 (running kernel: 5.4.44-2-pve)
pve-manager: 6.2-9 (running version: 6.2-9/4d363c5b)
pve-kernel-5.4: 6.2-4
pve-kernel-helper: 6.2-4
pve-kernel-5.3: 6.1-6
pve-kernel-5.4.44-2-pve: 5.4.44-2
pve-kernel-5.4.44-1-pve: 5.4.44-1
pve-kernel-5.4.41-1-pve: 5.4.41-1
pve-kernel-5.3.18-3-pve: 5.3.18-3
pve-kernel-4.13.13-2-pve: 4.13.13-33
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.4-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
ksm-control-daemon: 1.3-1
libjs-extjs: 6.0.1-10
libknet1: 1.16-pve1
libproxmox-acme-perl: 1.0.4
libpve-access-control: 6.1-2
libpve-apiclient-perl: 3.0-3
libpve-common-perl: 6.1-5
libpve-guest-common-perl: 3.1-1
libpve-http-server-perl: 3.0-6
libpve-storage-perl: 6.2-3
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 4.0.2-1
lxcfs: 4.0.3-pve3
novnc-pve: 1.1.0-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.2-9
pve-cluster: 6.1-8
pve-container: 3.1-11
pve-docs: 6.2-5
pve-edk2-firmware: 2.20200531-1
pve-firewall: 4.1-2
pve-firmware: 3.1-1
pve-ha-manager: 3.0-9
pve-i18n: 2.1-3
pve-qemu-kvm: 5.0.0-10
pve-xtermjs: 4.3.0-1
qemu-server: 6.2-10
smartmontools: 7.1-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.4-pve1

Bash:
root@pve:~# qm config 100
agent: 1
boot: cdn
bootdisk: scsi0
cores: 4
cpu: Broadwell-noTSX
memory: 8192
name: ubuntu
net0: virtio=EE:FB:87:2A:9E:CB,bridge=vmbr0
numa: 0
onboot: 1
ostype: l26
protection: 1
scsi0: local-lvm:vm-100-disk-0,discard=on,size=60G,ssd=1
scsihw: virtio-scsi-single
smbios1: uuid=1958eecf-414a-4292-83b0-2203f6ea9d18
sockets: 1
startup: order=2
tablet: 0
usb0: host=0001:0000
usb1: host=174c:55aa,usb3=1
usb2: host=0658:0200
usb3: host=0bda:2838
vga: virtio
 
i have the same problem, in the console it is not freezed, so i think it could be a network problem (virtual network problem) with ubuntu 20.04, (its my only 20.04 deploy)
 
I also experienced Ubuntu 20.04 (but not 18.04) freezes without anything in the logs when passing through USB-ports (on a X470 Ryzen system).
When the usb3=0/1 option does not match the physical port (USB 2.0/3.0), the VM freezes completely when unplugging the USB-device.

For example my USB 2.0 KVM-switch will freeze Ubuntu when unplugged from a physical USB 3.0 port when I use usb0: host=x-y.z,usb3=0, but it will work fine if I use usb0: host=x-y.z,usb3=1
Maybe you are running into a similar issue with your host USB-port passthrough, and can use the same work-around?
 
I also experienced Ubuntu 20.04 (but not 18.04) freezes without anything in the logs when passing through USB-ports (on a X470 Ryzen system).
When the usb3=0/1 option does not match the physical port (USB 2.0/3.0), the VM freezes completely when unplugging the USB-device.

For example my USB 2.0 KVM-switch will freeze Ubuntu when unplugged from a physical USB 3.0 port when I use usb0: host=x-y.z,usb3=0, but it will work fine if I use usb0: host=x-y.z,usb3=1
Maybe you are running into a similar issue with your host USB-port passthrough, and can use the same work-around?

I experience similar thing. If i touch a USB device (not plug/unplug, only move a bit the cable...) the VM is stopped... Not freeze, stopped. I try your idea, it possible to help me. The original problem is bit different (freezing) but possible to somehow connected this....
 
For example my USB 2.0 KVM-switch will freeze Ubuntu when unplugged from a physical USB 3.0 port when I use usb0: host=x-y.z,usb3=0, but it will work fine if I use usb0: host=x-y.z,usb3=1

I am also seeing this issue, and my setup is very similar with a USB 2.0 KVM switch, but unfortunately the usb 2.0 <-> 3.0 mismatch did not seem to fix the issue for me. To clarify, though, are you passing through physical ports or USB IDs? I am using vendor IDs for my devices, not the port itself. I can try switching to specific ports and see if that clears it up.
 
I do pass through using physical port numbers. And I was convinced that matching the usb3-flag with the physical connectors fixed it...

However, I just had another Ubuntu VM freeze when switching away from it. No matter what ports (2.0 or 3.0) I use with the usb3-flag, the VM keeps freezing today.
Watchdog does not kick in and a Stop with SIGKILL is necessary to restart the Ubuntu VM. USB unplugging worked fine two days ago

Seems that the usb3-flag is a red herring and not a work-around. It now appears that it is sort of random whether it will work fine multiple times, or just keeps freezing.

PS:
I also tried using device_add usb-host,bus=xhci.0,hostbus=... and device_del instead of USB-port passthrough: same effect today, Ubuntu VM freezes.
I also tried booting (a clone of) the VM from the Ubuntu 20.04 live/install CD and it does not freeze when unplugging and replugging keyboard and mouse.
I installed LMDE 4 (Linux Mint Debian) on a clone of the VM and it does not freeze upon USB removal.
I also installed and updated Linux Mint 20 (same kernel as Ubuntu) and at first it did not freeze when unplugging and replugging keyboard and mouse, but after a Shutdown and Start it does freeze.
Unplug and replug while in the GRUB-menu looks like it results in a VM freeze as well, as it does not respond anymore and needs a SIGKILL during Stop.
Even when it does not freeze the first time, repeatedly unplugging an USB-stick will eventually freeze Ubuntu or LMDE live CD.
This might be related to [Latest] Proxmox - USB disconnects freeze KVM ?

PPS:
It can also be reproduced using echo "$UsbPort" >/sys/bus/usb/drivers/usb/unbind, which makes it testable in an automated fashion.
 
Last edited:
My problem was pretty stupid, it was a network issue alright, i assigned the same ip to more than one vm.
 
Hi all,

I'm getting the what I think is the same issue as vamp, an Ubuntu VM with USB and also PCI sound card passthrough enabled will freeze up, seemingly at random (sometimes a couple of minutes in, sometimes an hour or two in, sometimes before Ubuntu reaches the login screen). When it freezes, I have no console access, no network access (can't ping or connect via SSH), and any audio playing through the sound card will play whatever note it was playing at the moment of the freeze as a continuous droning noise. I've tried disabling the PCI device in case that was the reason but that doesn't seem to make a difference as it still freezes, although I haven't tried disabling VFIO yet to see if that makes a difference.

Like skytrooper09, I am using vendor/hw IDs to pass through the USB devices. I can happily unplug and plug back in the USB devices without causing the VM to freeze so in my case I think USB is not directly responsible, but perhaps worth noting that if I unplug and re-plug the USB devices in after the guest has locked up then the USB devices remain attached to the host (i.e. the keyboard now enters input to the Proxmox server console).

Most recently it froze at 14:55, here are the logs from that time:

Code:
Jul 29 14:54:00 px0 systemd[1]: Started Proxmox VE replication runner.
Jul 29 14:55:00 px0 systemd[1]: Starting Proxmox VE replication runner...
Jul 29 14:55:00 px0 systemd[1]: pvesr.service: Succeeded.
Jul 29 14:55:00 px0 systemd[1]: Started Proxmox VE replication runner.
Jul 29 14:55:01 px0 CRON[30973]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul 29 14:55:32 px0 kernel: [238750.695872] usb 1-2-port4: disabled by hub (EMI?), re-enabling...
Jul 29 14:55:32 px0 kernel: [238750.696583] usb 1-2.4: USB disconnect, device number 20
Jul 29 14:55:32 px0 kernel: [238750.946763] usb 1-2.4: new full-speed USB device number 21 using xhci_hcd
Jul 29 14:55:33 px0 kernel: [238751.299492] usb 1-2.4: New USB device strings: Mfr=0, Product=2, SerialNumber=0
Jul 29 14:55:33 px0 kernel: [238751.319249] input: USB Gaming Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4/1-2.4:1.1/0003:04D9:FC07.0043/input/input107
Jul 29 14:55:33 px0 kernel: [238751.450907] input: USB Gaming Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4/1-2.4:1.2/0003:04D9:FC07.0044/input/input109
Jul 29 14:55:44 px0 kernel: [238763.102972] hid-generic 0003:04D9:FC07.0046: input,hidraw1: USB HID v1.10 Keyboard [USB Gaming Mouse] on usb-0000:00:14.0-2.4/input1
Jul 29 14:55:44 px0 kernel: [238763.112287] input: USB Gaming Mouse Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4/1-2.4:1.2/0003:04D9:FC07.0047/input/input112
Jul 29 14:56:00 px0 systemd[1]: Starting Proxmox VE replication runner...
Jul 29 14:56:00 px0 systemd[1]: pvesr.service: Succeeded.
Jul 29 14:56:00 px0 systemd[1]: Started Proxmox VE replication runner.

Code:
top - 15:16:23 up 2 days, 18:40,  1 user,  load average: 1.23, 1.23, 1.10
Tasks: 549 total,   2 running, 547 sleeping,   0 stopped,   0 zombie
%Cpu(s): 12.7 us,  0.4 sy,  0.0 ni, 84.9 id,  0.0 wa,  0.0 hi,  2.0 si,  0.0 st
MiB Mem :  32056.7 total,   6532.8 free,  23737.6 used,   1786.3 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.   7394.6 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                           
23863 root      20   0 7294788   6.1g   7380 S 100.0  19.4  21:45.24 kvm                                                                                               
 2408 root      20   0 1578752   1.0g   6732 R   2.7   3.3 172:07.45 kvm                                                                                               
16156 root      20   0 1692452   1.0g   7212 S   2.0   3.4   1:31.83 kvm

proxmox_103_frozen.png

Code:
root@px0:~# qm status 103 && qm pending 103
status: running
cur balloon: 0
cur bios: ovmf
cur boot: dcn
cur bootdisk: scsi0
cur cores: 2
cur cpu: kvm64,hidden=1
cur efidisk0: local-zfs:vm-103-disk-1,size=1M
cur hostpci0: 00:1b,pcie=1
cur ide2: local:iso/ubuntu-20.04-desktop-amd64.iso,media=cdrom,size=2651616K
cur machine: q35
cur memory: 6144
cur name: vlw0-disco
cur net0: virtio=56:D8:72:84:3A:8B,bridge=vmbr1,firewall=1
cur numa: 0
cur ostype: l26
cur scsi0: local-zfs:vm-103-disk-0,size=32G,ssd=1
cur scsihw: virtio-scsi-pci
cur serial0: socket
cur smbios1: uuid=60d0cdd4-552f-4212-8163-f6f4896114e4
cur sockets: 2
cur usb0: host=0c45:760a,usb3=1
cur usb1: host=04d9:fc07,usb3=1
cur usb2: host=13fd:1040,usb3=1
cur vcpus: 4
cur vga: none
cur vmgenid: 8943a8a6-8437-4601-8598-3e32eb4a753b

At the time of the freeze, top shows one of the KVM threads locked at 100% usage. After that, I don't know how to debug Qemu/KVM any further! Is there a way of seeing what the VM is waiting for (e.g. memory / storage operation, network operation, PCI / USB)?

I added a serial interface to the VM as well, but connecting with qm terminal didn't show anything useful (to me).

Host / guest info:

Code:
root@px0:~# pveversion -v
proxmox-ve: 6.2-1 (running kernel: 5.4.44-2-pve)
pve-manager: 6.2-10 (running version: 6.2-10/a20769ed)
pve-kernel-5.4: 6.2-4
pve-kernel-helper: 6.2-4
pve-kernel-5.3: 6.1-6
pve-kernel-5.4.44-2-pve: 5.4.44-2
pve-kernel-5.4.41-1-pve: 5.4.41-1
pve-kernel-5.3.18-3-pve: 5.3.18-3
pve-kernel-5.3.13-1-pve: 5.3.13-1
pve-kernel-5.3.10-1-pve: 5.3.10-1
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.4-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: residual config
ifupdown2: 3.0.0-1+pve2
ksm-control-daemon: 1.3-1
libjs-extjs: 6.0.1-10
libknet1: 1.16-pve1
libproxmox-acme-perl: 1.0.4
libpve-access-control: 6.1-2
libpve-apiclient-perl: 3.0-3
libpve-common-perl: 6.1-5
libpve-guest-common-perl: 3.1-1
libpve-http-server-perl: 3.0-6
libpve-storage-perl: 6.2-5
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 4.0.2-1
lxcfs: 4.0.3-pve3
novnc-pve: 1.1.0-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.2-9
pve-cluster: 6.1-8
pve-container: 3.1-12
pve-docs: 6.2-5
pve-edk2-firmware: 2.20200531-1
pve-firewall: 4.1-2
pve-firmware: 3.1-1
pve-ha-manager: 3.0-9
pve-i18n: 2.1-3
pve-qemu-kvm: 5.0.0-11
pve-xtermjs: 4.3.0-1
qemu-server: 6.2-11
smartmontools: 7.1-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.4-pve1

Code:
root@px0:~# cat /etc/pve/qemu-server/103.conf 
balloon: 0
bios: ovmf
boot: dcn
bootdisk: scsi0
cores: 2
cpu: kvm64,hidden=1
efidisk0: local-zfs:vm-103-disk-1,size=1M
hostpci0: 00:1b,pcie=1
ide2: local:iso/ubuntu-20.04-desktop-amd64.iso,media=cdrom,size=2651616K
machine: q35
memory: 6144
name: vlw0-disco
net0: virtio=56:D8:72:84:3A:8B,bridge=vmbr1,firewall=1
numa: 0
ostype: l26
scsi0: local-zfs:vm-103-disk-0,size=32G,ssd=1
scsihw: virtio-scsi-pci
serial0: socket
smbios1: uuid=60d0cdd4-552f-4212-8163-f6f4896114e4
sockets: 2
usb0: host=0c45:760a,usb3=1
usb1: host=04d9:fc07,usb3=1
usb2: host=13fd:1040,usb3=1
vcpus: 4
vga: none
vmgenid: 8943a8a6-8437-4601-8598-3e32eb4a753b

And also in case it's relevant the PCI device mentioned above is:
00:1b.0 Audio device: Intel Corporation 9 Series Chipset Family HD Audio Controller

This started happening to me roughly at the beginning of the month after I ran though apt upgrade / dist-upgrade, which included updating to the newest kernel so I'm wondering if it's a bug introduced by the update (since it would correlate with OP's issues starting).

Before then I've been using this same VM in this same config since September last year with no issues at all.

Any help debugging / insight would be amazing and much appreciated, and if I get to the bottom of my issue I'll report back here in case it's similar to anyone else's :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!