[New User] Cannot get any vm to install/Boot.


Recommended Posts

Hiya, I'm a brand new UNRAID user looking into using unraid as my main computer setup. I have UNRAID setup on another machine for testing before I purchase a license and have figured out how to setup a basic NAS for my home network but I cannot get any vm to install or boot if I try to import say an existing drive or hyper-v VHD (Converted to raw vDisk.img using QEMU-IMG) When I attempt to install a linux os wether linux, arch, or ubuntu it cannot mount /dev/sda on /media with outcome invalid argument. This I think is what causes the drive to not show up for install location/partitioning.

I have followed MANY tutorials and threads to try and get this working including the very common mistake of typing GB instead of just G which can cause such mounting errors. This was also all done on latest stable version 6.9.2

I will provide my vm XML files in pastebins below there corrisponding screenshots.

Screencap when booting from converted VHD: image.png.19c22a668a8fa03cbc3d0cca9581d6f0.png
XML: https://pastebin.com/T3C5ZdEz


Screencap when loading linux distro installer: image.png.652828e1f636a9cc6d323b93339522ae.png

XML: https://pastebin.com/dsaAd8Jd

 

Link to comment

@The Fantastic Loki Are these source vhd files from an legacy or uefi vm? This is besides missing hdd drivers for the guest the most common issues. When setting up your VM the next time, using an converted vhd file, try switching between the 2 different BIOS versions OVMF(UEFI boot) and SeaBIOS(legacy boot) and see if this helps. Missing drivers could also be the cause. If you install a VM inside Virtualbox for example, installing the guest additions, you install special drivers for Virtualbox. Drivers for virtio or scsi controllers used in Qemu/KVM aren't included and are missing trying to boot these vhds in unraid. Either you install the drivers from the virtio iso inside the source VM under VirtualBox for example, or you set your "Primary vDisk Bus type" to sata or IDE. When creating a new VM in unraid to install a fresh linux, arch ubuntu or whatever, don't use an existing somehow converted vdisk, creat it new from scatch with unraid with the gui. Simply enter 50G for a 50GB vdisk, leave the rest as it is and you should be good to go.

  • Like 1
Link to comment

The reply from @bastl contains some useful suggestions and correct information.

 

Anyway:

1. your converted disk is not booting because you're using ovmf and your disk doesn't have any efi partition (see UEFI interactive shell, see no FS0 in the mapping table). Moreover, depending on the hardware version set in your vm with the "old" hypervisor, this may be incompatible with the machine type version you are using.

This is a common issue with converted vmware images, for example.

Update the hardware version of your vm in the old hypervisor and use seabios in qemu.

As said use compatible emulated controllers, which don't need any additional drivers (sata is preferred).

 

2. Did you format the disk before installing? sda is your vdisk, use gparted if your installation media doesn't allow you to format it before installing files.

Edited by ghost82
  • Like 1
Link to comment

I tried gparted but then it always tries to boot straight to the drive and not the installer. idk why yet and I did what you said for the converted disk and got it to say booting from hard drive but it just stays there and never boots and doesn't throw any errors in vnc view or in logs. does the same thing when trying to boot straight from a drive passed through to a vm (need this to transfer main setup to unraid.

Link to comment
6 minutes ago, The Fantastic Loki said:

but then it always tries to boot straight to the drive and not the installer

From your original code:

    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/Parrot-kde-security-4.11.1_amd64.iso'/>
      <target dev='hda' bus='sata'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/ParrotOS/vdisk1.img'/>
      <target dev='hdc' bus='sata'/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>

If you have the same type of code for the gparted vm, delete both boot order lines, or set boot order = 1 for the cdrom iso and delete the boot order line for the disk.

Link to comment
On 6/21/2021 at 6:24 AM, ghost82 said:

From your original code:


    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/Parrot-kde-security-4.11.1_amd64.iso'/>
      <target dev='hda' bus='sata'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/ParrotOS/vdisk1.img'/>
      <target dev='hdc' bus='sata'/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>

If you have the same type of code for the gparted vm, delete both boot order lines, or set boot order = 1 for the cdrom iso and delete the boot order line for the disk.

I tried this and it boots to the installer yet the drive still fails to show inside installer so I can't actually install the os.

I'd also like to figure out how to just boot straight from a drive so I can implement unraid into my Main Rig, But it just gets stuck at booting from hard disk. and I see no option for where to provide the virtio iso so those can get installed or whatever.

Link to comment
8 hours ago, The Fantastic Loki said:

I tried this and it boots to the installer yet the drive still fails to show inside installer so I can't actually install the os.

May be an issue with the parrot os: first check that the sha256 of the iso is that reported to where you downloaded it, so to be sure the image is not corrupted in some way.

Try to boot from the cdrom and go with the live, once booted in the live environment I read that you should have a link on the desktop to install the os.

 

8 hours ago, The Fantastic Loki said:

I'd also like to figure out how to just boot straight from a drive

Different options:

1a. emulated controller, hd passthrough, whole disk

You emulate a sata or virtio controller to which your passedthrough hd is attached

 

1b. emulated controller, hd partitions passthrough

Same as above, but you passthrough the partitions of a disk instead of the whole disk

 

2. controller passthrough

You passthrough the controller, no need to emulate it, no need to define disks in the vm settings

 

For all the above cases you will find lots of resources in this forum.

 

9 hours ago, The Fantastic Loki said:

I see no option for where to provide the virtio iso so those can get installed

You define a virtual cdrom with the virtio disk iso attached, but it's not enough to have virtio drivers installed you need to install it; that's why you choose sata to boot, whose drivers are included in every os, and once booted you install the virtio drivers from the mounted iso, and finally, once the virtio drivers are installed, you change from sata to virtio.

In a windows installation you can directly use virtio devices because before installing it, when the disk window pop up, you can choose to install additional drivers so that the virtio disks can be detected.

Link to comment
Quote

Try to boot from the cdrom and go with the live, once booted in the live environment I read that you should have a link on the desktop to install the os.

1. This worked somewhat where I could get the drive to show using it's gparted in the live instance but now I get this error on installation: image.png.010dfe013cece48962d5e58bd6ed17bf.png

 

Quote

1a. emulated controller, hd passthrough, whole disk

You emulate a sata or virtio controller to which your passedthrough hd is attached

2. You mean like this cause this also gets stuck on booting from hard drive.
image.thumb.png.f28a108955fc3aeb1b73d7a3cd3439ec.png

Link to comment
4 hours ago, The Fantastic Loki said:

1. This worked somewhat where I could get the drive to show using it's gparted in the live instance but now I get this error on installation: image.png.010dfe013cece48962d5e58bd6ed17bf.png

 

You are trying to install grub on a disk with a gpt partition table, but the installer cannot find a bios partition.

I don't know how the parrot installer works, but before installing grub, since you are using ovmf, you need to create the UEFI partition (usually 200MB, up to 550MB), formatted as FAT32.

If you have access to terminal, here is an example about how to create a sda1 uefi partition on sda with gdisk:

gdisk
/dev/sda
n
1
<press Enter to accept default value>
<press Enter to accept default value>
EF00
w
--------------------------------------
mkfs.fat -F 32 /dev/sda1

Then, before installing grub you also need to mount it, in my manjaro system it is mounted on /boot/efi (check parrot manual to find where it wants to be mounted).

You should refer to "how to install parrot": in general for linux+uefi you need an UEFI FAT32 partition, a linux filesystem partition (ex: ext4, xfs, btrfs, etc.) (and a swap partition), each mounted before installing files.

 

4 hours ago, The Fantastic Loki said:

2. You mean like this cause this also gets stuck on booting from hard drive.
image.thumb.png.f28a108955fc3aeb1b73d7a3cd3439ec.png

Yes, though it's better to specify the path not with "sdX" but with "by-id", so to not have issue if the "X" changes.

 

The fact that is not booting may depends on other factors, including ovmf vs seabios, "corrupted boot", lack of drivers.

If it's a linux system and I would like to use ovmf, I would manually create the efi partition (if it's already there there's no need), boot from a live iso, chroot into the installation and run boot-repair or grub-repair on the boot partition.

Take into account that if you don't know what you are doing you may destroy your data, so make a backup first.

 

Edited by ghost82
Link to comment
1 hour ago, The Fantastic Loki said:

can't get the other vm with drive passthrough to boot. it has windows installed on it

 

Boot the bare metal installation and check if this is a uefi or bios installation.

https://itsfoss.com/check-uefi-or-bios/

 

Create a new virtual machine q35 type + ovmf (if it's a uefi installation), or q35 type + seabios (if it's a bios installation), with no virtio devices (including network).

If it fails share this xml.

 

What is the drive with the windows installed on? SATA?

 

I never tried to passthrough the disk (I'm passing through the whole sata controller), but from the spaceinvadersone video make sure that that disk is not mounted with unassigned devices.

Edited by ghost82
Link to comment
52 minutes ago, The Fantastic Loki said:

can't boot from ssd without the other hard drive plugged in

It seems (but I may be wrong) that you installed windows with the secondary drive plugged in and during installation the uefi partition was created on the hdd instead of the ssd, where all the other files were installed.

Something like this:

 

win.thumb.png.459c5c6704d6075dd84cc0b6c0476042.png

You can check if this is the case in disk management.

 

Edit: no you cannot check anymore, as you formatted :D

 

Now things are becoming more difficult, because if that is the case you don't have anymore the efi partition and you wont be able to boot windows...

 

This may work:

Quote

- Boot the computer using the Windows 7/8/8.1/10 installation media.
- On the first screen, press SHIFT+F10 to bring up the command prompt.
- Run the following commands at the command prompt.

diskpart
list disk
select disk # Note: Select the disk where you want to add the EFI System partition.
list partition
select partition # Note: Select the Windows OS partition (# number) or your data partition.
shrink desired=100
create partition efi size=100
format quick fs=fat32
assign letter=s
list partition
list volume ---> Note the volume letter where the Windows OS is installed.
exit

bcdboot X:\windows /s S:
Note: Replace "X" with the volume letter of the Windows OS partition.

 

Edited by ghost82
Link to comment
Quote

- Boot the computer using the Windows 7/8/8.1/10 installation media.
- On the first screen, press SHIFT+F10 to bring up the command prompt.
- Run the following commands at the command prompt.

diskpart
list disk
select disk # Note: Select the disk where you want to add the EFI System partition.
list partition
select partition # Note: Select the Windows OS partition (# number) or your data partition.
shrink desired=100
create partition efi size=100
format quick fs=fat32
assign letter=s
list partition
list volume ---> Note the volume letter where the Windows OS is installed.
exit

bcdboot X:\windows /s S:
Note: Replace "X" with the volume letter of the Windows OS partition.


I did that before formatted the drive and yes that's exactly what had happened the old drive was from when it was my little sisters computer and the ssd was from when I gave it to my little brother so they both had windows installs but the boot loader was on the hdd also it didn't work still couldn't boot from windows afterwords.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.