Re: [gentoo-user] Dual booting with Windows 10

2021-05-26 Thread Michael
On Tuesday, 25 May 2021 16:23:01 BST Peter Humphrey wrote:

> Thanks for the offer, Michael, but let me clear a few things up first.
> 
> 1.  I don't use symlinks in /boot.

This allows a simpler single boot partition (ESP) & filesystem set up (VFAT).


> 2.  I don't use grub, nor any other boot manager.

From what you've written below you have installed and now use systemd-boot.


> 3.  ...unless you count bootctl, from sys-boot/systemd-boot.

OK, bootctl is a command interfacing with the UEFI firmware API, while 
systemd-boot, once you install it, is a 3rd party boot manager as I've 
mentioned in my previous message.

Disambiguation:

a) UEFI boot manager - the 'native' EEPROM based UEFI boot loader/manager.  It 
scans all .efi executables, inc. Linux et al OS kernel images stored on the 
ESP;  updates and stores a list of .efi executables in its database and; 
presents them in the UEFI boot menu as manually selectable boot options.  
Unless the user enters the UEFI boot menu at start up, by pressing a key like 
F2, the first .efi executable on the list will be loaded and run.  The list of 
executables can be manipulated using the efibootmgr command, or the UEFI menu 
interface itself.

b) efibootmgr - a userspace command interfacing with the UEFI firmware API, 
used to manipulated the UEFI executable applications listed in the UEFI 
database.

c) bootctl - a userspace command interfacing with the UEFI firmware API like 
efibootmgr and also with the systemd-boot boot manager (if installed).

d) systemd-boot - a 3rd party boot manager (like GRUB, rEFInd, syslinux, 
etc.).


> 4.  I have the existing ESP mounted on /boot. It belongs to Windows and
> cannot be enlarged beyond 100MB.

This should not be a problem per se, unless bootctl & systemd-boot, with its 
own Boot Loader specification limitations, *must* be used as their developers 
intended (more below).  For example, on this box I have:

 # du -s -h /boot/*/*
3.1M/boot/BOOT/boot.sdi
1.6M/boot/EFI/Boot
27M /boot/EFI/Gentoo
25M /boot/EFI/Microsoft

My ESP is 273MB, but the MSWindows boot files plus Gentoo with two kernels (no 
initrd.gz) take up only 56.7M.  I could add two more kernels in there and 
still receive change from 100M - mind you some kernels are more frugally 
configured than others.

I notice you have /dev/nvme1n1p1 named as "boot".  Is this a secondary boot 
partition?  What is its mountpoint?  What does it contain?


> 5.  I have a small second system on the Gentoo disk called Rescue, so I have
> a multiple-boot system.
> 
> # tree -L 3 /boot
> /boot
> ├── EFI
> │   ├── Boot
> │   │   └── bootx64.efi
> │   ├── Linux
> │   ├── Microsoft
> │   │   ├── Boot
> │   │   └── Recovery
> │   └── systemd
> │   └── systemd-bootx64.efi
> ├── System.map-5.10.27-gentoo
> ├── System.map-5.10.27-gentoo-rescue
> ├── amd-uc.img
> ├── config-5.10.27-gentoo
> ├── config-5.10.27-gentoo-rescue
> ├── loader
> │   ├── entries
> │   │   ├── 08-gentoo-rescue-5.10.27.conf
> │   │   ├── 09-gentoo-rescue-5.10.27.nonet.conf
> │   │   ├── 30-gentoo-5.10.27.conf
> │   │   ├── 32-gentoo-5.10.27.nox.conf
> │   │   └── 34-gentoo-5.10.27.nonet.conf
> │   ├── loader.conf
> │   └── random-seed
> ├── vmlinuz-5.10.27-gentoo
> └── vmlinuz-5.10.27-gentoo-rescue
> 
> # parted -l
> [...]
> Model: Samsung SSD 970 EVO Plus 250GB (nvme)
> Disk /dev/nvme0n1: 250GB
> Sector size (logical/physical): 512B/512B
> Partition Table: gpt
> Disk Flags:
> 
> Number  Start   EndSizeFile system  Name Flags
>  1  1049kB  106MB  105MB   fat32EFI system partition boot, esp
>  2  106MB   123MB  16.8MB   Microsoft reserved partition  
> msftres 
>  3  123MB   249GB  249GB   ntfs Basic data partition msftdata
>  4  249GB   250GB  580MB   ntfs Basic data partition hidden,
> diag
> 
> Model: Samsung SSD 970 EVO Plus 250GB (nvme)
> Disk /dev/nvme1n1: 250GB
> Sector size (logical/physical): 512B/512B
> Partition Table: gpt
> Disk Flags:
> 
> Number  Start   End SizeFile system Name  Flags
>  1  1049kB  269MB   268MB   ext4boot
>  2  269MB   34.6GB  34.4GB  linux-swap(v1)  swap-1swap
>  3  34.6GB  51.8GB  17.2GB  ext4rescue
>  4  51.8GB  86.2GB  34.4GB  ext4root
>  5  86.2GB  90.5GB  4295MB  ext4local
>  6  90.5GB  103GB   12.9GB  ext4home
>  7  103GB   129GB   25.8GB  ext4common
> [...]
> 
> I followed the installation handbook, boot-loader section, to create a UEFI
> boot entry. I followed the syntax precisely, with several variations at
> various attempts. In every case, the UEFI BIOS listed the new entry but
> couldn't execute it.

This should work to launch your systemd-boot:

efibootmgr --create --disk /dev/nvme0n1 --part 1 --label "systemd-boot" --
loader "\EFI\Boot\bootx64.efi"

This would also work, if vmlinuz-5.10.27-gentoo, config-5.10.27-gentoo, and 
System.map-5.10.27-gentoo are st

[gentoo-user] QEMU not running on new machine

2021-05-26 Thread Walter Dnes
  With my older machine locking up once too often at in-opportune times,
I've switched over to a newer machine, which I've tried to set up
identically.  QEMU is not laumching.  It worked on the older system.
The error message is...

[x8940][waltdnes][~] /home/misc/qemu/arca/boot
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize kvm: No such file or directory

  My user is a member of the kvm group, and I get the same error trying
to launch as root

My system...

* 12-core Intel Skylake with 16 gigs of ram, 64-bit gentoo

* Yes, KVM support is installed in the kernel...
[x8940][waltdnes][~] zgrep KVM_INTEL /proc/config.gz 
CONFIG_KVM_INTEL=y

* make.conf contains
QEMU_SOFTMMU_TARGETS="i386 x86_64"
QEMU_USER_TARGETS="i386 x86_64"

* including flags in package.use, I get
[x8940][waltdnes][/etc/portage/package.use] emerge -pv qemu

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R] app-emulation/qemu-5.2.0-r3::gentoo  USE="aio alsa bzip2 curl 
doc fdt gtk jpeg opengl oss png sdl slirp ssh usb vhost-net vnc -accessibility 
-caps (-capstone) -debug -filecaps -glusterfs -gnutls -infiniband -io-uring 
-iscsi -jack -jemalloc -lzo -multipath -ncurses -nfs -nls -numa 
-pin-upstream-blobs -plugins -pulseaudio -python -rbd -sasl -sdl-image -seccomp 
(-selinux) -smartcard -snappy -spice -static -static-user -systemtap -test 
-udev -usbredir -vde -vhost-user-fs -virgl -virtfs -vte -xattr -xen -xfs -zstd" 
PYTHON_TARGETS="python3_8 -python3_7 -python3_9" QEMU_SOFTMMU_TARGETS="i386 
x86_64 -aarch64 -alpha -arm -avr -cris -hppa -lm32 -m68k -microblaze 
-microblazeel -mips -mips64 -mips64el -mipsel -moxie -nios2 -or1k -ppc -ppc64 
-riscv32 -riscv64 -rx -s390x -sh4 -sh4eb -sparc -sparc64 -tricore -unicore32 
-xtensa -xtensaeb" QEMU_USER_TARGETS="i386 x86_64 -aarch64 -aarch64_be -alpha 
-arm -armeb -cris -hppa -m68k -microblaze -microblazeel -mips -mips64 -mips64el 
-mipsel -mipsn32 -mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64abi32 -ppc64le 
-riscv32 -riscv64 -s390x -sh4 -sh4eb -sparc -sparc32plus -sparc64 -tilegx 
-xtensa -xtensaeb" 0 KiB

* The startup script is...

[x8940][waltdnes][~] cat /home/misc/qemu/arca/boot
#!/bin/bash
cd /home/misc/qemu/arca
sudo /usr/bin/qemu-system-x86_64 -enable-kvm -runas waltdnes \
   -cpu host -monitor vc -display gtk \
   -drive file=arcac.img,format=raw \
   -netdev user,id=mynetwork \
   -device e1000,netdev=mynetwork \
   -rtc base=localtime,clock=host \
   -m 1024 -name "ArcaOS VM" \
   -vga std -parallel none \
   ${@}

  I repeat. it worked on the older machine.

-- 
Walter Dnes 
I don't run "desktop environments"; I run useful applications



Re: [gentoo-user] QEMU not running on new machine

2021-05-26 Thread Branko Grubić
On Wed, 2021-05-26 at 12:50 -0400, Walter Dnes wrote:
>   With my older machine locking up once too often at in-opportune
> times,
> I've switched over to a newer machine, which I've tried to set up
> identically.  QEMU is not laumching.  It worked on the older system.
> The error message is...
> 
> [x8940][waltdnes][~] /home/misc/qemu/arca/boot
> Could not access KVM kernel module: No such file or directory
> qemu-system-x86_64: failed to initialize kvm: No such file or directory
> 
>   My user is a member of the kvm group, and I get the same error trying
> to launch as root
> 
> My system...
> 
> * 12-core Intel Skylake with 16 gigs of ram, 64-bit gentoo
> 
> * Yes, KVM support is installed in the kernel...
> [x8940][waltdnes][~] zgrep KVM_INTEL /proc/config.gz 
> CONFIG_KVM_INTEL=y
> 
> * make.conf contains
> QEMU_SOFTMMU_TARGETS="i386 x86_64"
> QEMU_USER_TARGETS="i386 x86_64"
> 
> * including flags in package.use, I get
> [x8940][waltdnes][/etc/portage/package.use] emerge -pv qemu
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies... done!
> [ebuild   R    ] app-emulation/qemu-5.2.0-r3::gentoo  USE="aio alsa
> bzip2 curl doc fdt gtk jpeg opengl oss png sdl slirp ssh usb vhost-net
> vnc -accessibility -caps (-capstone) -debug -filecaps -glusterfs -
> gnutls -infiniband -io-uring -iscsi -jack -jemalloc -lzo -multipath -
> ncurses -nfs -nls -numa -pin-upstream-blobs -plugins -pulseaudio -
> python -rbd -sasl -sdl-image -seccomp (-selinux) -smartcard -snappy -
> spice -static -static-user -systemtap -test -udev -usbredir -vde -
> vhost-user-fs -virgl -virtfs -vte -xattr -xen -xfs -zstd"
> PYTHON_TARGETS="python3_8 -python3_7 -python3_9"
> QEMU_SOFTMMU_TARGETS="i386 x86_64 -aarch64 -alpha -arm -avr -cris -hppa
> -lm32 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -
> moxie -nios2 -or1k -ppc -ppc64 -riscv32 -riscv64 -rx -s390x -sh4 -sh4eb
> -sparc -sparc64 -tricore -unicore32 -xtensa -xtensaeb"
> QEMU_USER_TARGETS="i386 x86_64 -aarch64 -aarch64_be -alpha -arm -armeb
> -cris -hppa -m68k -microblaze -microblazeel -mips -mips64 -mips64el -
> mipsel -mipsn32 -mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64abi32 -
> ppc64le -riscv32 -riscv64 -s390x -sh4 -sh4eb -sparc -sparc32plus -
> sparc64 -tilegx -xtensa -xtensaeb" 0 KiB
> 
> * The startup script is...
> 
> [x8940][waltdnes][~] cat /home/misc/qemu/arca/boot
> #!/bin/bash
> cd /home/misc/qemu/arca
> sudo /usr/bin/qemu-system-x86_64 -enable-kvm -runas waltdnes \
>    -cpu host -monitor vc -display gtk \
>    -drive file=arcac.img,format=raw \
>    -netdev user,id=mynetwork \
>    -device e1000,netdev=mynetwork \
>    -rtc base=localtime,clock=host \
>    -m 1024 -name "ArcaOS VM" \
>    -vga std -parallel none \
>    ${@}
> 
>   I repeat. it worked on the older machine.
> 

Hi,

What comes to my mind is actually describe in here[1]. Possibly
virtualization is disabled in BIOS/Firmware.


[1] https://wiki.gentoo.org/wiki/QEMU#BIOS_and_UEFI_firmware




Re: [gentoo-user] QEMU not running on new machine

2021-05-26 Thread Walter Dnes
On Wed, May 26, 2021 at 07:43:59PM +0200, Branko Grubi?? wrote
> 
> Hi,
> 
> What comes to my mind is actually describe in here[1]. Possibly
> virtualization is disabled in BIOS/Firmware.
> 
> 
> [1] https://wiki.gentoo.org/wiki/QEMU#BIOS_and_UEFI_firmware

  Thank you very much; that was it.  QEMU is now up and running.  I had
to dig through to almost the end of the BIOS setup to find and click on
"Enable Intel virtualization technology".

-- 
Walter Dnes 
I don't run "desktop environments"; I run useful applications