opsi client boot cd

Benutzeravatar
SisterOfMercy
Beiträge: 1016
Registriert: 22 Jun 2012, 19:18

opsi client boot cd

Beitragvon SisterOfMercy » 07 Okt 2019, 21:54

I am trying to install a windows VM on a FreeBSD/Bhyve host.
It is bhyve, so graphics only work in uefi mode. The CentOS text installer does not allow manual partition, so the CentOS VM uses the uefi method too.

CentOS iso: works fine
Windows iso: works fine
Network boot: doesn't work (elilo keeps writing dots)
Opsi client boot iso: crashes somewhere (presumably when changing resolution)

Bhyve log shows this:

Code: Alles auswählen

rdmsr to register 0x140 on vcpu 0
wrmsr to register 0x140(0) on vcpu 0
rdmsr to register 0x140 on vcpu 1
wrmsr to register 0x140(0) on vcpu 1
rdmsr to register 0x34 on vcpu 1
Unhandled inb 0x03d0 at 0xffffffff8240f645
fbuf frame buffer base: 0x942e00000 [sz 16777216]
XXX vga_port_in_handler() unhandled port 0x3d0


I've tried editing the command lines before booting, but I do not seem to get anywhere. I've tried to change the stuff to what the CentOS iso uses, which works:

Code: Alles auswählen

set default="1"

function load_video {
  insmod efi_gop
  insmod efi_uga
  insmod video_bochs
  insmod video_cirrus
  insmod all_video
}

load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2

set timeout=60
### END /etc/grub.d/00_header ###

search --no-floppy --set=root -l 'CentOS 7 x86_64'

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Install CentOS 7' --class fedora --class gnu-linux --class gnu --class os {
   linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet
   initrdefi /images/pxeboot/initrd.img
}
menuentry 'Test this media & install CentOS 7' --class fedora --class gnu-linux --class gnu --class os {
   linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rd.live.check quiet
   initrdefi /images/pxeboot/initrd.img
}
submenu 'Troubleshooting -->' {
   menuentry 'Install CentOS 7 in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
      linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 xdriver=vesa nomodeset quiet
      initrdefi /images/pxeboot/initrd.img
   }
   menuentry 'Rescue a CentOS system' --class fedora --class gnu-linux --class gnu --class os {
      linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rescue quiet
      initrdefi /images/pxeboot/initrd.img
   }
}


For comparison, this is the grub.cfg of the opsi boot iso:

Code: Alles auswählen

if loadfont /boot/grub/font.pf2 ; then
   set gfxmode=auto
        insmod efi_gop
   insmod efi_uga
   insmod gfxterm
   insmod gfsterm_background
   insmod png
   background_image -m stretch /boot/grub/opsi.png
   terminal_output gfxterm
fi

#GRUB_GFXMODE=640x4i80
#GRUB_BACKGROUND="/boot/grub/opsi.tga"

insmod png
background_image -m stretch /boot/grub/opsi.png

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

submenu "64 Bit Bootimage -->" {
insmod png
background_image -m stretch /boot/grub/opsi.png

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
menuentry "Start opsi (english)" {
        set gfxpayload=keep
        linux   /vmlinuz-x64 boot=lang=en video=vesa:ywrap,mtrr vga=791 service ---
        initrd  /miniroot-x64.bz2
}
menuentry "Start opsi without DHCP (english)" {
        set gfxpayload=keep
        linux   /vmlinuz-x64 boot=lang=en video=vesa:ywrap,mtrr vga=791 service nodhcp ---
        initrd  /miniroot-x64.bz2
}
menuentry "Opsi starten (deutsch)" {
        set gfxpayload=keep
        linux   /vmlinuz-x64 boot=lang=de video=vesa:ywrap,mtrr vga=791 service ---
        initrd  /miniroot-x64.bz2
}
menuentry "Opsi ohne DHCP starten (deutsch)" {
        set gfxpayload=keep
        linux   /vmlinuz-x64 boot=lang=de video=vesa:ywrap,mtrr vga=791 service nodhcp ---
        initrd  /miniroot-x64.bz2
}
menuentry "Start opsi (french)" {
        set gfxpayload=keep
        linux   /vmlinuz-x64 boot=lang=fr video=vesa:ywrap,mtrr vga=791 service ---
        initrd  /miniroot-x64.bz2
}
menuentry "Start opsi without DHCP (french)" {
        set gfxpayload=keep
        linux   /vmlinuz-x64 boot=lang=fr video=vesa:ywrap,mtrr vga=791 service nodhcp ---
        initrd  /miniroot-x64.bz2
}
menuentry "Start opsi (italian)" {
        set gfxpayload=keep
        linux   /vmlinuz-x64 boot=lang=it video=vesa:ywrap,mtrr vga=791 service ---
        initrd  /miniroot-x64.bz2
}
menuentry "Start opsi without DHCP (italian)" {
        set gfxpayload=keep
        linux   /vmlinuz-x64 boot=lang=it video=vesa:ywrap,mtrr vga=791 service nodhcp ---
        initrd  /miniroot-x64.bz2
}
menuentry "Start opsi (danish)" {
        set gfxpayload=keep
        linux   /vmlinuz-x64 boot=lang=da video=vesa:ywrap,mtrr vga=791 service ---
        initrd  /miniroot-x64.bz2
}
menuentry "Start opsi without DHCP (danish)" {
        set gfxpayload=keep
        linux   /vmlinuz-x64 boot=lang=da video=vesa:ywrap,mtrr vga=791 service nodhcp ---
        initrd  /miniroot-x64.bz2
}
}

submenu "32 Bit Bootimage -->" {
insmod png
background_image -m stretch /boot/grub/opsi.png

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
menuentry "Start opsi (english)" {
        set gfxpayload=keep
        linux   /vmlinuz boot=lang=en video=vesa:ywrap,mtrr vga=791 service ---
        initrd  /miniroot.bz2
}
menuentry "Start opsi without DHCP (english)" {
        set gfxpayload=keep
        linux   /vmlinuz boot=lang=en video=vesa:ywrap,mtrr vga=791 service nodhcp ---
        initrd  /miniroot.bz2
}
menuentry "Opsi starten (deutsch)" {
        set gfxpayload=keep
        linux   /vmlinuz boot=lang=de video=vesa:ywrap,mtrr vga=791 service ---
        initrd  /miniroot.bz2
}
menuentry "Opsi ohne DHCP starten (deutsch)" {
        set gfxpayload=keep
        linux   /vmlinuz boot=lang=de video=vesa:ywrap,mtrr vga=791 service nodhcp ---
        initrd  /miniroot.bz2
}
menuentry "Start opsi (french)" {
        set gfxpayload=keep
        linux   /vmlinuz boot=lang=fr video=vesa:ywrap,mtrr vga=791 service ---
        initrd  /miniroot.bz2
}
menuentry "Start opsi without DHCP (french)" {
        set gfxpayload=keep
        linux   /vmlinuz boot=lang=fr video=vesa:ywrap,mtrr vga=791 service nodhcp ---
        initrd  /miniroot.bz2
}
menuentry "Start opsi (italian)" {
        set gfxpayload=keep
        linux   /vmlinuz boot=lang=it video=vesa:ywrap,mtrr vga=791 service ---
        initrd  /miniroot.bz2
}
menuentry "Start opsi without DHCP (italian)" {
        set gfxpayload=keep
        linux   /vmlinuz boot=lang=it video=vesa:ywrap,mtrr vga=791 service nodhcp ---
        initrd  /miniroot.bz2
}
menuentry "Start opsi (danish)" {
        set gfxpayload=keep
        linux   /vmlinuz boot=lang=da video=vesa:ywrap,mtrr vga=791 service ---
        initrd  /miniroot.bz2
}
menuentry "Start opsi without DHCP (danish)" {
        set gfxpayload=keep
        linux   /vmlinuz boot=lang=da video=vesa:ywrap,mtrr vga=791 service nodhcp ---
        initrd  /miniroot.bz2
}
}


I can't edit anything in the first if, so those modules will get loaded.
Anybody have some ideas what to try now?
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!

Benutzeravatar
ThomasT
uib-Team
Beiträge: 161
Registriert: 26 Jun 2013, 12:26

Re: opsi client boot cd

Beitragvon ThomasT » 08 Okt 2019, 07:59

How did you spec the VM?
Kein Support per DM!
_________________________
opsi support - https://www.uib.de/
For productive opsi installations we recommend support contracts.

Benutzeravatar
SisterOfMercy
Beiträge: 1016
Registriert: 22 Jun 2012, 19:18

Re: opsi client boot cd

Beitragvon SisterOfMercy » 08 Okt 2019, 16:34

This is the vm-bhyve configuration file:

Code: Alles auswählen

# cat windows.conf
debug="yes"
guest="windows"
loader="uefi"
cpu="2"
memory="4G"
utctime="yes"
hostbridge="standard"
virt_random="yes"
disk0_type="ahci-hd"
disk0_dev="sparse-zvol"
disk0_name="disk0"
network0_type="virtio-net"
network0_switch="public"
graphics="yes"
graphics_port="5902"
graphics_res="800x600"
graphics_wait="no"
xhci_mouse="yes"
zfs_zvol_opts="volblocksize=128k compress=lz4"
uuid="f7ab2bb9-e912-11e9-a2b9-0025902ceec4"
network0_mac="58:9c:fc:08:8f:18"


However, I have new stuff to try, because I found this in the FreeBSD 11.3 release notes:
"Open Issues
[2019-07-04] An issue which can cause a crash when connecting to a bhyve(4) instance with a VNC client under certain circumstances had been reported. An errata notice is planned post-release."

That might be it. I've also seen a way to run windows without VNC graphics, but this would need a silent installation. Which will obviously not work with the current implementation with elilo.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!

Benutzeravatar
SisterOfMercy
Beiträge: 1016
Registriert: 22 Jun 2012, 19:18

Re: opsi client boot cd

Beitragvon SisterOfMercy » 08 Okt 2019, 20:39

Ok, now it still crashes, but at least not in the beginning.

Updated FreeBSD to 12.0-RELEASE. Same problem.
Found some setting for vm-bhyve: graphics_vga="off"

Now I can get into master.py. Then it crashes on the hardware inventory. This is the same as with virtualbox on FreeBSD. Great :( :cry:
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!

Benutzeravatar
m.radtke
uib-Team
Beiträge: 756
Registriert: 10 Jun 2015, 12:19

Re: opsi client boot cd

Beitragvon m.radtke » 08 Okt 2019, 20:47

Hi

is there any message during the crash?
Any suspicious messages in dmesg?

Cheers
Mathias
Kein Support per DM!
_________________________
opsi support - http://www.uib.de/
For productive opsi installations we recommend support contracts.

Benutzeravatar
SisterOfMercy
Beiträge: 1016
Registriert: 22 Jun 2012, 19:18

Re: opsi client boot cd

Beitragvon SisterOfMercy » 08 Okt 2019, 22:00

m.radtke hat geschrieben:is there any message during the crash?
Any suspicious messages in dmesg?


Not really. I must be doing something wrong in regard to what info it shows.
dmesg:

Code: Alles auswählen

tap1: Ethernet address: 00:bd:f6:07:5f:01
tap1: promiscuous mode enabled
tap1: link state changed to UP
pid 25618 (bhyve), uid 0: exited on signal 6
tap1: link state changed to DOWN


vm-bhyve.log

Code: Alles auswählen

Oct 08 20:29:47: initialising
Oct 08 20:29:47:  [loader: uefi]
Oct 08 20:29:47:  [cpu: 2]
Oct 08 20:29:47:  [memory: 4G]
Oct 08 20:29:47:  [hostbridge: standard]
Oct 08 20:29:47:  [com ports: com1]
Oct 08 20:29:47:  [uuid: f7ab2bb9-e912-11e9-a2b9-0025902ceec4]
Oct 08 20:29:47:  [utctime: yes]
Oct 08 20:29:47:  [debug mode: yes]
Oct 08 20:29:47:  [primary disk: disk0]
Oct 08 20:29:47:  [primary disk dev: sparse-zvol]
Oct 08 20:29:47: initialising network device tap1
Oct 08 20:29:47: adding tap1 -> vm-public (public addm)
Oct 08 20:29:47: bring up tap1 -> vm-public (public addm)
Oct 08 20:29:47: booting
Oct 08 20:29:47:  [bhyve options: -c 2 -m 4G -Hwl bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -U f7ab2bb9-e912-11e9-a2b9-0025902ceec4 -u]
Oct 08 20:29:47:  [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,ahci-hd,/dev/zvol/zroot/vm/trillian/disk0 -s 5:0,virtio-net,tap1,mac=58:9c:fc:08:8f:18 -s 6:0,virtio-rnd -s 7:0,fbuf,tcp=0.0.0.0:5902,w=1024,h=768,vga=off -s 8:0,xhci,tablet]
Oct 08 20:29:47:  [bhyve console: -l com1,/dev/nmdm-trillian.1A]
Oct 08 20:29:47:  [bhyve iso device: -s 3:0,ahci-cd,/vm/.iso/opsi4.1.0-client-boot-cd_20190829.iso,ro]
Oct 08 20:29:47: starting bhyve (run 1)
Oct 08 20:34:13: bhyve exited with status 139
Oct 08 20:34:13: destroying network device tap1
Oct 08 20:34:13: stopped


bhyve.log

Code: Alles auswählen

rdmsr to register 0x140 on vcpu 0
wrmsr to register 0x140(0) on vcpu 0
rdmsr to register 0x140 on vcpu 1
wrmsr to register 0x140(0) on vcpu 1
rdmsr to register 0x34 on vcpu 1
Unhandled ps2 mouse command 0xe1


I can't even find what exit status 139 is for bhyve. The last thing it shows in the VNC session is "running hardware audit". What is it doing there? I've opened up master.py, but ehhh.. Or is it running the setup.py from the product (win2019 in this case)?
I'm trying to find out at which command/line it crashes.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!

Benutzeravatar
SisterOfMercy
Beiträge: 1016
Registriert: 22 Jun 2012, 19:18

Re: opsi client boot cd

Beitragvon SisterOfMercy » 09 Okt 2019, 12:36

Is every hardware audit the same? I am trying to install win2019.

Code: Alles auswählen

auditHardwareOnHosts = auditHardware(config = hwconfig, hostId = clientId)


If every script does the same, where can I find the code it runs?
Is it here? https://github.com/opsi-org/python-opsi ... /Object.py

I'm trying to find the exact step where it goes wrong. It could be hardware related (the virtualbox machine has the same motherboard), emulation related (bhyve and vbox), host related or guest related.
All other VMs seem to run just fine, rock solid actually.

edit: It has worked before, somewhere around 4.0.5
I've always thought it was some vbox problem, but now with bhyve it seems to be more having to do with the boot image. If the hw audit is the cause, can I use a old boot image to test this, or should I replace the hwaudit product with an ancient version?
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!