Re: Arch Linux UEFI Bhyve Setup

2017-01-17 Thread Vincent Olivier
Hi Peter,

It works! Thanks so much to everyone who helped me! I will see about the 
stability of this thing in the next few days. If it is as stable as the 
MBR/GRUB VMs, I will redo them all.

Regards,

Vincent





> Le 9 janv. 2017 à 01:28, Peter Grehan  a écrit :
> 
> Hi Vincent,
> 
>> Nothing works with UEFI console for me so I think I’m going to stick
>> with BIOS-MBR-GRUB for now, unless you have an idea I can try…
> 
> The live ISO can be repacked to work with a serial console. The only 
> complication is that the systemd-boot (aka gummiboot, Arch's UEFI loader) are 
> embedded in a FAT filesystem image.
> 
> The repack steps are:
> 
> 1. Install the cdrtools-devel package to get mkisofs
> 
> 2. Extract the contents of the Arch iso into a working directory
> 
>   # cd /path/to/work_dir
>   # tar xf /path/to/archlinux-2017.01.01-dual.iso
> 
> 3. Find the label of the ISO (to be used in the repack)
> 
>   # isoinfo -d -i /path/to/archlinux-2017.01.01-dual.iso | grep ^Volume\ id
>   Volume id: ARCH_201701
> 
> 4. Set up a vnode-backed md for the FAT boot image and mount it
> 
>   # mdconfig -f EFI/archiso/efiboot.img
>   # mount_msdosfs /dev/md0  /mnt
> 
> 5. Edit the config file, adding serial console lines to the 'options' line
> 
>   # vi /mnt/loader/entries/archiso-x86_64.conf
>   
>   options archisobasedir=arch archisolabel=ARCH_201701 console=tty0 
> console=ttyS0
> 
> 6. Unmount the filesystem (updating the FAT filesystem image) and cleanup the 
> md
> 
>   # umount /mnt
>   # mdconfig -d -u 0
> 
> 7. Repack the ISO, using the volume ID from step 3. Change the
>   name of the repacked iso to whatever is suitable with the '-o'
>   parameter.
> 
>   # mkisofs \
> -iso-level 3 \
> -V "ARCH_201701" \
> -J -joliet-long \
> -b isolinux/isolinux.bin -no-emul-boot -c isolinux/boot.cat \
> -boot-load-size 4 -boot-info-table \
> -eltorito-alt-boot -eltorito-platform 0xEF \
> -eltorito-boot EFI/archiso/efiboot.img \
> -no-emul-boot \
> -o ../arch_repack.iso .
> 
> The system can now be booted with a serial console. An example command line 
> with serial output on the nmdm device is
> 
> bhyve \
>  -c 2 \
>  -s 0,hostbridge \
>  -s 3,ahci-cd,/path/to/arch_repack.iso \
>  -s 10,virtio-net,tap0 \
>  -l bootrom,/path/to/BHYVE_UEFI_20160526.fd \
>  -l com1,/dev/nmdm0A \
>  -s 31,lpc \
>  -m 2G -H -w \
>  arch
> 
> later,
> 
> Peter.
> 
> 

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"

Re: Arch Linux UEFI Bhyve Setup

2017-01-08 Thread Peter Grehan

Hi Vincent,


Nothing works with UEFI console for me so I think I’m going to stick
with BIOS-MBR-GRUB for now, unless you have an idea I can try…


 The live ISO can be repacked to work with a serial console. The only 
complication is that the systemd-boot (aka gummiboot, Arch's UEFI 
loader) are embedded in a FAT filesystem image.


 The repack steps are:

1. Install the cdrtools-devel package to get mkisofs

2. Extract the contents of the Arch iso into a working directory

   # cd /path/to/work_dir
   # tar xf /path/to/archlinux-2017.01.01-dual.iso

3. Find the label of the ISO (to be used in the repack)

   # isoinfo -d -i /path/to/archlinux-2017.01.01-dual.iso | grep 
^Volume\ id

   Volume id: ARCH_201701

4. Set up a vnode-backed md for the FAT boot image and mount it

   # mdconfig -f EFI/archiso/efiboot.img
   # mount_msdosfs /dev/md0  /mnt

5. Edit the config file, adding serial console lines to the 'options' line

   # vi /mnt/loader/entries/archiso-x86_64.conf
   
   options archisobasedir=arch archisolabel=ARCH_201701 console=tty0 
console=ttyS0


6. Unmount the filesystem (updating the FAT filesystem image) and 
cleanup the md


   # umount /mnt
   # mdconfig -d -u 0

7. Repack the ISO, using the volume ID from step 3. Change the
   name of the repacked iso to whatever is suitable with the '-o'
   parameter.

   # mkisofs \
 -iso-level 3 \
 -V "ARCH_201701" \
 -J -joliet-long \
 -b isolinux/isolinux.bin -no-emul-boot -c isolinux/boot.cat \
 -boot-load-size 4 -boot-info-table \
 -eltorito-alt-boot -eltorito-platform 0xEF \
 -eltorito-boot EFI/archiso/efiboot.img \
 -no-emul-boot \
 -o ../arch_repack.iso .

 The system can now be booted with a serial console. An example command 
line with serial output on the nmdm device is


bhyve \
  -c 2 \
  -s 0,hostbridge \
  -s 3,ahci-cd,/path/to/arch_repack.iso \
  -s 10,virtio-net,tap0 \
  -l bootrom,/path/to/BHYVE_UEFI_20160526.fd \
  -l com1,/dev/nmdm0A \
  -s 31,lpc \
  -m 2G -H -w \
  arch

later,

Peter.


___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"

Re: Arch Linux UEFI Bhyve Setup

2017-01-07 Thread Georgios Amanakis via freebsd-virtualization
Dear Vincent,

GRUB2 in Archlinux normally boots in "graphical" mode. You have toswitch it to 
"text" mode. This is done by adding: 

-8<--
GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial --unit 0 --speed=115200 --stop=1 --
parity=no --word=8"
-8<--
into /etc/default/grub, and then run 
"grub-mkconfig -o /boot/grub/grub.cfg".

This should let you boot it under UEFI on bhyve by running:
"bhyve -u -A -H -P -s 0:0,hostbridge -s 31:0,lpc -s 14:0,virtio-
net,tap1 -s 3:0,virtio-blk,./linux.img -l com1,stdio -l
bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -c 1 -m 1024M
linuxguest".

Please, let us know if this solved your problem.

Best regards,
George
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"

Re: Arch Linux UEFI Bhyve Setup

2017-01-06 Thread Vincent Olivier
Hi,

So I tried something else, that ended up not working either. :(

I booted the installer in BIOS mode, and followed the instruction to make the 
vm disk UEFI-bootable here: https://wiki.archlinux.org/index.php/Systemd-boot

I omitted the intel microcode (I don’t think it applies to a virtual machine) 
and I added the “console=ttyS0” option.

When booting with UEFI, I still got stuck and there was no output whatsoever. I 
used the “vm” script with the uefi=“yes” option.

Nothing works with UEFI console for me so I think I’m going to stick with 
BIOS-MBR-GRUB for now, unless you have an idea I can try…

Thanks for everything.

Vincent


> On Jan 2, 2017, at 9:18 PM, Vincent Olivier  wrote:
> 
> Hi Peter! Thanks for this. I’m going to look at how to rebuild an Archlinux 
> ISO with that extra option later this week and see how it goes. Regards,
> 
> Vincent
> 
> 
>> Le 2 janv. 2017 à 15:52, Peter Grehan  a écrit :
>> 
>> Hi Vincent,
>> 
>>> I guess my resolution for 2017 is more clarity.
>>> 
>>> So what I mean to know with this experiment is simply this: can UEFI
>>> be used with a serial console (i.e.: without a graphic console), if
>>> so, is it preferable over GRUB for Linux distros that support UEFI?
>>> 
>>> Until I am positive about using UEFI over serial console, I will
>>> stick to GRUB but if someone coule elaborate on this, I would
>>> appreciate it greatly!
>> 
>> It does work, but you have to either edit the grub.conf on the install ISO 
>> and repack, or get in quick and edit the grub command line and add a 
>> 'console=ttyS0' option.
>> 
>> grub-bhyve auto-inserts the serial console line into the linux kernel boot 
>> options which is why it appears a little more seamless.
>> 
>> UEFI does have the advantage that the system is self-consistent - any boot 
>> filesystem can be used, whereas grub-bhyve only understands the ones that 
>> are built into it.
>> 
>> later,
>> 
>> Peter.
>> 
> 
> ___
> freebsd-virtualization@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to 
> "freebsd-virtualization-unsubscr...@freebsd.org"

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"

Re: Arch Linux UEFI Bhyve Setup

2017-01-02 Thread Vincent Olivier
Hi Peter! Thanks for this. I’m going to look at how to rebuild an Archlinux ISO 
with that extra option later this week and see how it goes. Regards,

Vincent


> Le 2 janv. 2017 à 15:52, Peter Grehan  a écrit :
> 
> Hi Vincent,
> 
>> I guess my resolution for 2017 is more clarity.
>> 
>> So what I mean to know with this experiment is simply this: can UEFI
>> be used with a serial console (i.e.: without a graphic console), if
>> so, is it preferable over GRUB for Linux distros that support UEFI?
>> 
>> Until I am positive about using UEFI over serial console, I will
>> stick to GRUB but if someone coule elaborate on this, I would
>> appreciate it greatly!
> 
> It does work, but you have to either edit the grub.conf on the install ISO 
> and repack, or get in quick and edit the grub command line and add a 
> 'console=ttyS0' option.
> 
> grub-bhyve auto-inserts the serial console line into the linux kernel boot 
> options which is why it appears a little more seamless.
> 
> UEFI does have the advantage that the system is self-consistent - any boot 
> filesystem can be used, whereas grub-bhyve only understands the ones that are 
> built into it.
> 
> later,
> 
> Peter.
> 

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"

Re: Arch Linux UEFI Bhyve Setup

2017-01-02 Thread Peter Grehan

Hi Vincent,


I guess my resolution for 2017 is more clarity.

So what I mean to know with this experiment is simply this: can UEFI
be used with a serial console (i.e.: without a graphic console), if
so, is it preferable over GRUB for Linux distros that support UEFI?

Until I am positive about using UEFI over serial console, I will
stick to GRUB but if someone coule elaborate on this, I would
appreciate it greatly!


 It does work, but you have to either edit the grub.conf on the install 
ISO and repack, or get in quick and edit the grub command line and add a 
'console=ttyS0' option.


 grub-bhyve auto-inserts the serial console line into the linux kernel 
boot options which is why it appears a little more seamless.


 UEFI does have the advantage that the system is self-consistent - any 
boot filesystem can be used, whereas grub-bhyve only understands the 
ones that are built into it.


later,

Peter.

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: Arch Linux UEFI Bhyve Setup

2017-01-01 Thread Vincent Olivier
Happy 2017 all,

I guess my resolution for 2017 is more clarity.

So what I mean to know with this experiment is simply this: can UEFI be used 
with a serial console (i.e.: without a graphic console), if so, is it 
preferable over GRUB for Linux distros that support UEFI?

Until I am positive about using UEFI over serial console, I will stick to GRUB 
but if someone coule elaborate on this, I would appreciate it greatly!

Thanks,

Vincent


> On Dec 31, 2016, at 9:26 AM, Vincent Olivier  wrote:
> 
> Hi,
> 
> A new thread for this same target setup: 
> https://twitter.com/MUP4/status/814595352112283649
> 
> Please note that the tap interface naming doesn’t follow the nomenclature in 
> the diagram as I am just testing isolated aspect of the setup for now.
> 
> The « Cinq » FreeBSD 11 machine already the ALTNET non-UEFI (grub-bhyve) 
> machine running Arch Linux. I wanted to try UEFI with the same Arch Linux 
> distro but it doesn’t seem to work.
> 
> Here is the grub-bhyve command sequence that I used for the Arch Linux 
> installer on the the ALTNET virtual machine:
> 
> zfs create -V4G -o volmode=dev bhyve/altnet
> 
> grub-bhyve -m /bhyve/altnet/setup/device.map -r cd0 -M 512M altnet < 
> /bhyve/altnet/setup/grub.cfg
> 
> bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 
> -s3:0,virtio-blk,/dev/zvol/bhyve/altnet -s 
> 4:0,ahci-cd,/bhyve/archlinux-2016.12.01-dual.iso -l com1,stdio -c 1 -m 512M 
> altnet
> 
> Here is its grub.cfg file:
> 
> linux (cd0)/arch/boot/x86_64/vmlinuz archisobasedir=arch 
> archisolabel=ARCH_201612 ro
> initrd (cd0)/arch/boot/x86_64/archiso.img
> boot
> 
> Here is its device.map file:
> 
> (cd0) /bhyve/archlinux-2016.12.01-dual.iso
> (hd0) /dev/zvol/bhyve/altnet
> 
> Here is my adaptation of the above for the UNIFI UEFI virtual machine, just 
> for the Arch Linux installer:
> 
> zfs create -V2G -o volmode=dev bhyve/unifi
> 
> bhyve -c 1 -m 512M -A -H -P \
>   -s 0:0,hostbridge \
>   -s 1:0,lpc \
>   -s 2:0,virtio-net,tap1 \
>   -s 3:0,virtio-blk,/dev/zvol/bhyve/unifi \
>   -s 4:0,ahci-cd,/bhyve/archlinux-2016.12.01-dual.iso \
>   -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
>   -l com1,stdio \
>   unifi
> 
> But when I run this, I get this:
> 
> Arch Linux archiso x86_64 UEFI CD
> UEFI Shell x86_64 v1
> UEFI Shell x86_64 v2
> EFI Default Loader
> Reboot Into Firmware Interface
> Boot in 1 sec.
> rdmsr to register 0x34 on vcpu 0
> Unhandled ps2 mouse command 0xe1
> Unhandled ps2 mouse command 0x0a
> Unhandled ps2 mouse command 0x01
> Unhandled ps2 mouse command 0x41
> 
> And then it stalls. I waited max 2 minutes and then I did a "bhyvectl 
> --destroy --vm=unifi” in another session. I tried different bhyve flags (-w, 
> etc.) to no avail.
> 
> Is there hope for me?
> 
> Happy new year!
> 
> Vincent

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"