UTM icon indicating copy to clipboard operation
UTM copied to clipboard

Ubuntu upgrade causes UTM to crash VM and corrupts it

Open brunocastello opened this issue 6 months ago • 5 comments

BEFORE SUBMITTING YOUR ISSUE, PLEASE LOOK AT THE PINNED ISSUES AND USE THE SEARCH FUNCTION TO MAKE SURE IT IS NOT ALREADY REPORTED. ALWAYS COMMENT ON AN EXISTING ISSUE INSTEAD OF MAKING A NEW ONE.

Describe the issue
Ubuntu upgrade causes UTM to crash VM and corrupts it. Then the machine no longer boots. UTM shows a popup message about an error related to "illegal byte sequence" several times, which I have to dismiss. The VM continues running until I shutdown or reboot. Then it no longer boots again due to being a corrupted image.

The VM is running Ubuntu 23.04 ARM64. I am attempting a full upgrade to latest version available.

The VM is also running from an external M2. NVMe SSD in a USB-C enclosure. I have never seen a such error in like 3 years running UTM.

Configuration

  • UTM Version: 4.4.5
  • macOS Version: macOS Sonoma 14.3
  • Mac Chip (Intel, M1, ...): Mac Studio M1 Max

Crash log
The app didn't crash, however showed a sequence of errors while trying to update a Ubuntu VM. "Illegal byte sequence"

Debug log
Unable to create one due to the machine being unable to boot again.

Upload VM
Well can't upload it due to sensitive data contained on it, plus the machine was replaced by a working backup.

brunocastello avatar Jan 31 '24 00:01 brunocastello

If you were using Apple virtualization your issue might be fixed by this pull request: https://github.com/utmapp/UTM/pull/5919

wrmack avatar Jan 31 '24 06:01 wrmack

Interesting. Can you explain to me in lay terms? As I can see, using NVMe solves it but its slower, right? For an existing Ubuntu VM, which uses a virtio drive, how do I work around this with regards to caching? Do I need to configure something or just wait for the PR to be merged?

brunocastello avatar Feb 01 '24 04:02 brunocastello

I think wait until PR is merged. In the meantime I am using Cirruslab Tart which is a command-line app for Apple virtualization. It meets my needs for linux. I have not noticed nvme being slower. Steps for doing this:

# Install tart
brew update
brew upgrade
brew install cirruslabs/cli/tart

# Set environment variable for location of VM (in my case an external SSD drive)
TART_HOME=/Volumes/p873445/VirtualMachines/Tart
export TART_HOME

# Create linux VM (I called mine ubuntu240105 - name is up to you)
tart create --linux ubuntu240105

# It is possible to set various configuration options - see:
tart set --help

# Install Ubuntu server (I downloaded Ubuntu 24.04 Noble)
tart run --disk ~/Downloads/noble-live-server-arm64.iso ubuntu240105

# Run Ubuntu server 
tart run ubuntu240105

# In Ubuntu server, login and install Ubuntu desktop. 
sudo apt update
sudo apt upgrade
sudo apt install ubuntu-desktop

# I updated kernel to latest mainline kernel

# Set resolution of grub menu (default was too small)
sudo nano /etc/default/grub

# then set:  GRUB_GFXMODE=1280x800
sudo grub-mkconfig -o /boot/grub/grub.cfg

I then created a small script for starting the VM each time I wanted to use it:

#! /bin/bash

TART_HOME=/Volumes/p873445/VirtualMachines/Tart
export TART_HOME
tart run ubuntu240105

I have not tried to get clipboard sharing with host working. I had some difficulty getting sound working but it is great now.

Hope this helps.

wrmack avatar Feb 01 '24 05:02 wrmack

Eh I'll wait for the PR. This VM isnt a daily driver but just a small web development env vm. I occasionally pop it up for some personal projects. Thanks for your help!

brunocastello avatar Feb 01 '24 12:02 brunocastello

Nvme might not be the solution?

https://github.com/utmapp/UTM/pull/5919#issuecomment-2027969787

gkyildirim avatar May 13 '24 16:05 gkyildirim