UTM icon indicating copy to clipboard operation
UTM copied to clipboard

Error trying to restore removable drives: Device 'drive1' is not removable

Open jacksonchui opened this issue 5 years ago • 9 comments

Describe the issue I am trying to install x86_64 Ubuntu 20.04.3 LTS Server in a VM but am running into an issue with removable disks. When I put the removable drive first in the drive order, I get "Error trying to restore removable drives: Device 'drive1' is not removable" when trying to start the VM.

I want to use UTM to run x86_64 Ubuntu 20.04.3 as a build target. Also if this works on Big Sur (i.e. Big Sur Host, x86_64 Ubuntu Guest), I'll just run it like that until Monterey is debugged.

I also tried to put the removable drive after my VirtIO disk and SeaBIOS starts, but I get:

Booting from DVD/CD...
Boot failed: Could not read from CDROM (code 0003)

Configuration

  • UTM Version: 2.1.2 (31)
  • OS Version: macOS Monterey 12.0 Beta 5 (21A5304g)
  • Intel or Apple Silicon? Apple Silicon

Crash log

N/A.

Debug log

Log with Removable USB as First Disk

Running:  -L /Applications/UTM.app/Contents/Resources/qemu -S -qmp tcp:127.0.0.1:4000,server,nowait -nodefaults -vga none -nographic -chardev "pipe,id=term0,path=/var/folders/6r/1p2rj_qj1fn_p8zsht58wmfh0000gn/T/com.utmapp.UTM/Ubuntu 20.04 LTS.terminal" -serial chardev:term0 -smp cpus=1,sockets=1,cores=1,threads=1 -machine pc-i440fx-6.0,vmport=off -accel tcg,tb-size=512 -global PIIX4_PM.disable_s3=1 -global ICH9-LPC.disable_s3=1 -boot menu=on -m 2048 -device AC97 -name "Ubuntu 20.04 LTS" -usb -device usb-tablet,bus=usb-bus.0 -device usb-mouse,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 -device ich9-usb-ehci1,id=usb-controller-0 -device ich9-usb-uhci1,masterbus=usb-controller-0.0,firstport=0,multifunction=on -device ich9-usb-uhci2,masterbus=usb-controller-0.0,firstport=2,multifunction=on -device ich9-usb-uhci3,masterbus=usb-controller-0.0,firstport=4,multifunction=on -chardev spicevmc,name=usbredir,id=usbredirchardev0 -device usb-redir,chardev=usbredirchardev0,id=usbredirdev0,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev2 -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2,bus=usb-controller-0.0 -device usb-storage,drive=drive0,removable=true,bootindex=0 -drive if=none,media=cdrom,id=drive0 -device virtio-blk-pci,drive=drive1,bootindex=1 -drive "if=none,media=disk,id=drive1,file=/Users/jacksonchui/Library/Containers/com.utmapp.UTM/Data/Documents/Ubuntu 20.04 LTS.utm/Images/disk-0.qcow2,cache=writethrough" -device rtl8139,mac=66:29:56:CE:2E:0A,netdev=net0 -netdev user,id=net0 -uuid DBAE4244-07DB-41C3-91B6-807A603D0D9E -rtc base=localtime
qemu-x86_64-softmmu: -accel tcg,tb-size=512: qemu_mprotect__osdep: mprotect failed: Permission denied
audio: Failed to create voice `ac97.pi'
audio: Failed to create voice `ac97.mc'
audio: Failed to create voice `ac97.pi'
audio: Failed to create voice `ac97.mc'
WARNING: Image format was not specified for '/Users/jacksonchui/cs 164 isos/ubuntu-20.04.3-live-server-arm64.iso' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
WARNING: Image format was not specified for '/Users/jacksonchui/cs 164 isos/ubuntu-20.04.3-live-server-arm64.iso' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.

Log with Removable USB as Second Disk

Running:  -L /Applications/UTM.app/Contents/Resources/qemu -S -qmp tcp:127.0.0.1:4000,server,nowait -nodefaults -vga none -nographic -chardev "pipe,id=term0,path=/var/folders/6r/1p2rj_qj1fn_p8zsht58wmfh0000gn/T/com.utmapp.UTM/Ubuntu 20.04 LTS.terminal" -serial chardev:term0 -smp cpus=1,sockets=1,cores=1,threads=1 -machine pc-i440fx-6.0,vmport=off -accel tcg,tb-size=512 -global PIIX4_PM.disable_s3=1 -global ICH9-LPC.disable_s3=1 -boot menu=on -m 2048 -device AC97 -name "Ubuntu 20.04 LTS" -usb -device usb-tablet,bus=usb-bus.0 -device usb-mouse,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 -device ich9-usb-ehci1,id=usb-controller-0 -device ich9-usb-uhci1,masterbus=usb-controller-0.0,firstport=0,multifunction=on -device ich9-usb-uhci2,masterbus=usb-controller-0.0,firstport=2,multifunction=on -device ich9-usb-uhci3,masterbus=usb-controller-0.0,firstport=4,multifunction=on -chardev spicevmc,name=usbredir,id=usbredirchardev0 -device usb-redir,chardev=usbredirchardev0,id=usbredirdev0,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev2 -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2,bus=usb-controller-0.0 -device virtio-blk-pci,drive=drive0,bootindex=0 -drive "if=none,media=disk,id=drive0,file=/Users/jacksonchui/Library/Containers/com.utmapp.UTM/Data/Documents/Ubuntu 20.04 LTS.utm/Images/disk-0.qcow2,cache=writethrough" -device usb-storage,drive=drive1,removable=true,bootindex=1 -drive if=none,media=cdrom,id=drive1 -device rtl8139,mac=66:29:56:CE:2E:0A,netdev=net0 -netdev user,id=net0 -uuid DBAE4244-07DB-41C3-91B6-807A603D0D9E -rtc base=localtime
qemu-x86_64-softmmu: -accel tcg,tb-size=512: qemu_mprotect__osdep: mprotect failed: Permission denied
audio: Failed to create voice `ac97.pi'
audio: Failed to create voice `ac97.mc'
audio: Failed to create voice `ac97.pi'
audio: Failed to create voice `ac97.mc'

Upload VM

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>ConfigurationVersion</key>
	<integer>2</integer>
	<key>Debug</key>
	<dict>
		<key>DebugLog</key>
		<true/>
		<key>IgnoreAllConfiguration</key>
		<false/>
	</dict>
	<key>Display</key>
	<dict>
		<key>ConsoleFont</key>
		<string>Menlo</string>
		<key>ConsoleFontSize</key>
		<integer>12</integer>
		<key>ConsoleOnly</key>
		<true/>
		<key>ConsoleTheme</key>
		<string>Default</string>
		<key>DisplayCard</key>
		<string>qxl-vga</string>
		<key>DisplayDownscaler</key>
		<string>linear</string>
		<key>DisplayUpscaler</key>
		<string>linear</string>
	</dict>
	<key>Drives</key>
	<array>
		<dict>
			<key>DriveName</key>
			<string>drive1</string>
			<key>ImageType</key>
			<string>cd</string>
			<key>InterfaceType</key>
			<string>usb</string>
			<key>Removable</key>
			<true/>
		</dict>
		<dict>
			<key>DriveName</key>
			<string>drive0</string>
			<key>ImagePath</key>
			<string>disk-0.qcow2</string>
			<key>ImageType</key>
			<string>disk</string>
			<key>InterfaceType</key>
			<string>virtio</string>
		</dict>
	</array>
	<key>Info</key>
	<dict>
		<key>Icon</key>
		<string>ubuntu</string>
		<key>IconCustom</key>
		<false/>
	</dict>
	<key>Input</key>
	<dict>
		<key>InputLegacy</key>
		<false/>
	</dict>
	<key>Networking</key>
	<dict>
		<key>NetworkCard</key>
		<string>rtl8139</string>
		<key>NetworkCardMAC</key>
		<string>66:29:56:CE:2E:0A</string>
		<key>NetworkMode</key>
		<string>emulated</string>
	</dict>
	<key>Printing</key>
	<dict/>
	<key>Sharing</key>
	<dict>
		<key>ClipboardSharing</key>
		<false/>
		<key>UsbRedirectMax</key>
		<integer>3</integer>
	</dict>
	<key>Sound</key>
	<dict>
		<key>SoundCard</key>
		<string>AC97</string>
		<key>SoundEnabled</key>
		<true/>
	</dict>
	<key>System</key>
	<dict>
		<key>AddArgs</key>
		<array>
			<string>-drive if=none,format=raw,media=cdrom,readonly,id=drive0</string>
		</array>
		<key>Architecture</key>
		<string>x86_64</string>
		<key>BootDevice</key>
		<string></string>
		<key>CPU</key>
		<string>default</string>
		<key>JITCacheSize</key>
		<integer>0</integer>
		<key>MachineProperties</key>
		<string>vmport=off</string>
		<key>Memory</key>
		<integer>2048</integer>
		<key>SystemUUID</key>
		<string>DBAE4244-07DB-41C3-91B6-807A603D0D9E</string>
		<key>Target</key>
		<string>pc-i440fx-6.0</string>
	</dict>
</dict>
</plist>

jacksonchui avatar Aug 27 '21 17:08 jacksonchui

I had the same issue (ubuntu based iso) and worked around it by adding the iso as a permanent drive and removing it after the installation did complete.

Rastafabisch avatar Aug 27 '21 22:08 Rastafabisch

I had a similar issue and fixed it by deleting all drives, saving the VM, re-adding all drives, and saving the VM. It seems to be due to a clashing identifier. If the HDD already has data, you can go into ~/Library/Containers/com.utmapp.UTM/Data/Documents/VM_NAME/Images/ and copy out HDD_NAME.img before deleting the HDD so that you can import it as a new HDD.

anonymousaga avatar Aug 28 '21 19:08 anonymousaga

I have observed this bug as well. If the removable drive is not last in the list, you can't start the VM. The other issue with the Could not read from CDROM (code 0003) is likely unrelated. Does this happen with other ISOs or just this one?

conath avatar Aug 29 '21 21:08 conath

Tried it with Debian 10 and Ubuntu 18.04 and it happened as well. I'll try the suggestions in the thread: thanks everyone for helping out!

jacksonchui avatar Aug 30 '21 02:08 jacksonchui

The main reason I needed CD-ROM to be first was to boot from a Live CD to do a drive partition resize. If you create a fresh VM and add the CD-ROM Drive first and then import the drive you want to resize, this error message doesn't pop up.

Not sure if this is helpful or not for other use cases.

If the removable drive is not first in the list, we cannot boot from it, at least from what I can tell. So creating a fresh one worked for the sole purpose of resizing an unmounted drive partition.

jamesmortensen avatar Oct 06 '21 04:10 jamesmortensen

Hi

I have a Kali linux that got disk full. I did the resize, but i am not able to boot from live CD to do the partition so to claim added space. I am also getting same error: "Error trying to restore removable drives: Device 'drive1' is not removable"

Can someone share steps/procedure on how to boot vm from live CD in UTM?

0xmang avatar Mar 24 '22 16:03 0xmang

@0xmang Try moving the CD drive down in the list of drives.

conath avatar Mar 26 '22 09:03 conath

I had a similar issue and fixed it by deleting all drives, saving the VM, re-adding all drives, and saving the VM. It seems to be due to a clashing identifier. If the HDD already has data, you can go into ~/Library/Containers/com.utmapp.UTM/Data/Documents/VM_NAME/Images/ and copy out HDD_NAME.img before deleting the HDD so that you can import it as a new HDD.

This worked for me!

toub1 avatar Apr 22 '22 16:04 toub1

I was presented with the same error message: "Error trying to restore removable drives: Device 'drive1' is not removable". I located the VM file which in my case is called Windows XP-3.utm and typed option +I and realized that the file was locked. In fact, I had locked it so I wouldn't accidentally delete it. So I unchecked the Lockdown box, rebooted the Mac, started UTM with the VM and it booted normally.

Betobito avatar May 13 '22 19:05 Betobito