Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on ARM
  • Search

Gentoo as guest on VirtualBox and Apple M4

Gentoo on all things ARM. Both 32 bit and 64 bit.
Tell about your hardware and CHOST.
Problems with crossdev targeting ARM hardware go here too.
Post Reply
  • Print view
Advanced search
15 posts • Page 1 of 1
Author
Message
Banana
Moderator
Moderator
User avatar
Posts: 2379
Joined: Fri May 21, 2004 12:02 pm
Location: Germany
Contact:
Contact Banana
Website

Gentoo as guest on VirtualBox and Apple M4

  • Quote

Post by Banana » Mon Apr 21, 2025 7:28 am

It is a first for me since I did not really needed it so far. But since I'm out of options I do want/need to get Gentoo running in virtualbox on an Apple M4 Pro.

EDIT/Update
I've decided to use UTM instead of virtualBox. See the replies for more details.

VirtualBox 7.1.8
EFI Option activated for this VM

Booted successfully the install-arm64-minimal, installed and configured everything until the first reboot. After that it gives me the error:

Code: Select all

...
/dev/root: can't open blockdev
VFS cannot open root device "PARTUUID=697f0ce2-fa91-4cf4-b3d2-b65017080775" or unknown-block(0,0): error -6
Please append a correcnt root .... available options
ext3
ext2
ext4
squashfs
vfat
msdos
exfat
xfs
Kernal panic - not syncing: ....
This looks to me something in the kernel is still missing.

Kernel config: https://paste.gentoo.zip/ACEcbqSS
Emerge info: https://bpa.st/MJ4A

fdisk -l

Code: Select all

Disk /dev/sda: 21.45 GiB, 23028826112 bytes, 44978176 sectors
Disk model: HARDDISK        
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 05BC9496-4918-4CF0-A08D-0F9F55332168

Device        Start      End  Sectors  Size Type
/dev/sda1      2048  2099199  2097152    1G EFI System
/dev/sda2   2099200 10487807  8388608    4G Linux swap
/dev/sda3  10487808 44976127 34488320 16.4G Linux root (ARM-64)


Disk /dev/loop0: 531.21 MiB, 557019136 bytes, 1087928 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Grub config: https://paste.gentoo.zip/tpmiDhQY

lspci info while in chroot

Code: Select all

00:00.0 VGA compatible controller: VMware SVGA II Adapter (Fusion)
	Subsystem: VMware SVGA II Adapter (Fusion)
	Kernel driver in use: vmwgfx
00:01.0 System peripheral: InnoTek Systemberatung GmbH VirtualBox Guest Service
00:03.0 SCSI storage controller: Red Hat, Inc. Virtio 1.0 SCSI (rev 01)
	Subsystem: Red Hat, Inc. Virtio 1.0 SCSI
	Kernel driver in use: virtio-pci
00:06.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller
	Kernel driver in use: xhci_hcd
00:08.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
	Subsystem: Intel Corporation PRO/1000 MT Desktop Adapter
	Kernel driver in use: e1000
blkid

Code: Select all

/dev/sr0: BLOCK_SIZE="2048" UUID="2025-04-14-02-06-36-00" LABEL="Gentoo-arm64-20250413T230515Z" TYPE="iso9660" PTTYPE="PMBR"
/dev/loop0: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/sda2: UUID="11b148a3-0f2f-4b7c-ba85-cf6fd13f6b40" TYPE="swap" PARTUUID="d92f625c-6a62-425c-b346-ce953bbfab0c"
/dev/sda3: UUID="64e89f9b-9ecc-4410-8551-7dee050a53e6" BLOCK_SIZE="512" TYPE="xfs" PARTUUID="697f0ce2-fa91-4cf4-b3d2-b65017080775"
/dev/sda1: UUID="C30C-7274" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="6875b87d-d048-42dd-b0f0-32f5b3e74d41"
Any hints are welcome.
Last edited by Banana on Thu May 08, 2025 6:25 am, edited 2 times in total.
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Top
Koyan
n00b
n00b
Posts: 41
Joined: Fri Nov 07, 2014 11:26 pm

  • Quote

Post by Koyan » Mon Apr 21, 2025 10:25 am

Not a direct answer to your question, but I can strongly recommend UTM instead of VirtualBox. It's basically a macos fork of QEMU, so everything runs at native speed. I have a few Gentoo VMs (as well as a Windows 11 and 7 vm) running great on my Mac mini M4 on UTM. https://mac.getutm.app/
Top
pingtoo
Advocate
Advocate
User avatar
Posts: 2180
Joined: Fri Sep 10, 2021 8:37 pm
Location: Richmond Hill, Canada

Re: Gentoo as guest on VirtualBox and Apple M4

  • Quote

Post by pingtoo » Mon Apr 21, 2025 10:44 am

Banana wrote:It is a first for me since I did not really needed it so far. But since I'm out of options I do want/need to get Gentoo running in virtualbox on an Apple M4 Pro.

VirtualBox 7.1.8
EFI Option activated for this VM

Booted successfully the install-arm64-minimal, installed and configured everything until the first reboot. After that it gives me the error:

Code: Select all

...
/dev/root: can't open blockdev
VFS cannot open root device "PARTUUID=64e89f9b-9ecc-4410-8551-7dee050a53e6" or unknown-block(0,0): error -6
Please append a correcnt root .... available options
ext3
ext2
ext4
squashfs
vfat
msdos
exfat
xfs
Kernal panic - not syncing: ....
This looks to me something in the kernel is still missing.
How did you boot into this entry in GRUB? the "64e89f9b-9ecc-4410-8551-7dee050a53e6" is your rootfs UUID, not partition UUID. And from your grub.conf I did not see any menuentry use that fs-UUID, they all use correct PARTUUID for root device.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56080
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Mon Apr 21, 2025 11:09 am

Banana,

Code: Select all

unknown-block(0,0)
tells that the kernel cannot see any block devices at all.

You need the bits for

Code: Select all

00:03.0 SCSI storage controller: Red Hat, Inc. Virtio 1.0 SCSI (rev 01)
   Subsystem: Red Hat, Inc. Virtio 1.0 SCSI
   Kernel driver in use: virtio-pci 
If virtio is in use, your guest drive drive should be vda, not sda.
You get sda when you use emulated hardware.

Your kernel looks OK in that department.

VirtualBox on arm64 is new to me. I've always used QEMU with virt-manager.
How is the guest HDD connected in the guest setup in Virtualbox?
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Banana
Moderator
Moderator
User avatar
Posts: 2379
Joined: Fri May 21, 2004 12:02 pm
Location: Germany
Contact:
Contact Banana
Website

  • Quote

Post by Banana » Mon Apr 21, 2025 12:13 pm

Koyan wrote:Not a direct answer to your question, but I can strongly recommend UTM instead of VirtualBox. It's basically a macos fork of QEMU, so everything runs at native speed. I have a few Gentoo VMs (as well as a Windows 11 and 7 vm) running great on my Mac mini M4 on UTM. https://mac.getutm.app/
Oh, thx. I might give this a try.
pingtoo wrote:How did you boot into this entry in GRUB? the "64e89f9b-9ecc-4410-8551-7dee050a53e6" is your rootfs UUID, not partition UUID. And from your grub.conf I did not see any menuentry use that fs-UUID, they all use correct PARTUUID for root device.
Oh, this is a typo. Since I only have a screenshot of that error message, I written it off the screenshot and lazy copy pasted the wrong UUID of the blkid output.
So the PARTUUID from grub does match the error message. Gonna correct it in the first post.
NeddySeagoon wrote:tells that the kernel cannot see any block devices at all.
Yeah, but why. Usuall it comes from missing fstype support. But my kernel does have xfs. Which is also displayed in the error message.
NeddySeagoon wrote:If virtio is in use, your guest drive drive should be vda, not sda.
You get sda when you use emulated hardware.
But using the partuuid should make the difference irrelevant?
NeddySeagoon wrote:VirtualBox on arm64 is new to me. I've always used QEMU with virt-manager.
How is the guest HDD connected in the guest setup in Virtualbox?
It is attached as a .vdi file. The settings tells me that it is a "VID (VirtualBox Disk Image)". But there are other options available: VHD, VNDK, HDD, QCOW, QED

But I don't think that this is a problem, because the install-arm64-minimal-*.iso can work with it.
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Top
pingtoo
Advocate
Advocate
User avatar
Posts: 2180
Joined: Fri Sep 10, 2021 8:37 pm
Location: Richmond Hill, Canada

  • Quote

Post by pingtoo » Mon Apr 21, 2025 12:25 pm

I think we need to see more on boot messages in order to understand how kernel see the VM.

Can you add serial console to VM so you can save the messages somewhere and share it.
Top
Banana
Moderator
Moderator
User avatar
Posts: 2379
Joined: Fri May 21, 2004 12:02 pm
Location: Germany
Contact:
Contact Banana
Website

  • Quote

Post by Banana » Mon Apr 21, 2025 12:42 pm

pingtoo wrote:I think we need to see more on boot messages in order to understand how kernel see the VM.

Can you add serial console to VM so you can save the messages somewhere and share it.
Well, I did some search and came up with this: https://gist.github.com/snb/284940/11e6 ... ed49ebd143
Used the file output, since the other options did not work or the commends are not available, but the result was strange. Only three lines are recored.
Something like starting uefi... and then nothing.
The boot does show more stuff. But now I do not even get the mentioned error message from the first post and stops at "md: ... autorun DONE." and does nothing further.
Not even without the serialport... I'm confused and do not really remember changing anything to the VM...
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Top
pingtoo
Advocate
Advocate
User avatar
Posts: 2180
Joined: Fri Sep 10, 2021 8:37 pm
Location: Richmond Hill, Canada

  • Quote

Post by pingtoo » Mon Apr 21, 2025 1:02 pm

I don't know virtualbox enough to comment on how to setup serial port. I too use UTM.

One option could be introduce initrd into boot, so it is possible to examine kernel view use early root (in memroy)

Did you change grub to add "console=tty0 console=ttyS0,115200n8" on kernel command line argument?

I ask Gemini, it said for the "Port Mode:" It is possible to use "Raw File", do your virtualbox gave you this option?

Just thought of another test. what if you change the kernel command line argument root=/dev/sda3 or root=/dev/vda3 to just test if there is a right driver in kernel.
Top
Banana
Moderator
Moderator
User avatar
Posts: 2379
Joined: Fri May 21, 2004 12:02 pm
Location: Germany
Contact:
Contact Banana
Website

  • Quote

Post by Banana » Mon Apr 21, 2025 2:49 pm

I was able to set it to a file but as mentioned did not record anything usefull.

I've managed to grab a screenshot with the changed boot cmd. No look so far:
https://pasteboard.co/v2ArHjgbqdvX.png

I'm not bound to virtualBox. I will give it some more rounds and then try utm. Any suggestion about that or is it straight forward?
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Top
pingtoo
Advocate
Advocate
User avatar
Posts: 2180
Joined: Fri Sep 10, 2021 8:37 pm
Location: Richmond Hill, Canada

  • Quote

Post by pingtoo » Mon Apr 21, 2025 5:32 pm

I don't know if you tried with /dev/vda3 as well, however if it also failed that mean driver missing, however I don't know kernel enough to simply read .config file to see what is missing, I usually depend on looking at dmesg and lsmod and compare with a successful boot to figure out what missing.

for UTM, I have not tried with gentoo kernel yet. I just use alpinelinux iso which work out of box without me doing anything. However this is just simple test boot, I do container inside a alpinelinux host. BTW, mine is MacBook Pro M2 (MBP)

Try with other livecd, alpinelinux or ubuntu so you can identify modules required and from working dmesg usually can identify what is needed.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56080
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Mon Apr 21, 2025 5:39 pm

Banana,

Code: Select all

unknown-block(0,0)
tells that the kernel cannot see any block devices at all.
If you get

Code: Select all

unknown-block(major,minor)
it tells that the kernel can find the block device with major,minor number but not read what it finds.
That's usually a missing filesystem. Its not got that far.

Notice the line at

Code: Select all

 0.8472223 Please append a correct "root=" boot option; here are the available partitions: 
The list is empty, so the kernel can't see any partitions.

xfs is listed in bdev filesfstems, so you are good there.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
flysideways
Guru
Guru
Posts: 527
Joined: Sat Jan 29, 2005 1:06 pm

  • Quote

Post by flysideways » Tue Apr 22, 2025 12:48 am

I have been successfully using arm64 sys-kernel/Gentoo-kernel on an M1 MacBook Pro in both UTM and VMWare Fusion for a while now.

In addition to Gentoo, arm64 versions of Alpine, Debian, and Kali, have also successfully run in both UTM and VMWare Fusion for me on the M1 Apple Silicon.

I am glad to see Virtualbox also now available for Apple Silicon, and was intending to try it when I find the time.
Top
Banana
Moderator
Moderator
User avatar
Posts: 2379
Joined: Fri May 21, 2004 12:02 pm
Location: Germany
Contact:
Contact Banana
Website

  • Quote

Post by Banana » Mon Apr 28, 2025 12:52 pm

Thx for the feedback so far. Wasn't able to do anything in this topic lately.

I currently had success in booting after the normal handbook install on UTM and arm64 minimal cd image.
I'm not yet sure what was the change which made it work, but I will gather some info and write them down.
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Top
Banana
Moderator
Moderator
User avatar
Posts: 2379
Joined: Fri May 21, 2004 12:02 pm
Location: Germany
Contact:
Contact Banana
Website

  • Quote

Post by Banana » Fri May 02, 2025 9:38 am

Current state about running it with UTM (version 4.6.5).
  • UTM with default settings for this VM
  • Used the install-arm64-minimal iso to boot from
  • Used the default handbook Used https://wiki.gentoo.org/wiki/Handbook:AMD64
  • GPT, UEFI and dhcpd
  • It is not /dev/sdam, it is /dev/vda
  • arm stage file
  • Manual kernel config
  • Using Grub, no initramfs
I do think now that the combination of GRUB and those VIRTIO config settings in the kernel did the trick.
Using efi stub did not work.

One of the last changes to the kernel was adding CONFIG_VIRTIO_FS. CONFIG_VIRTIO_BLK was already there, so it looks like the _FS was needed.

Code: Select all

CONFIG_BLK_MQ_VIRTIO=y
CONFIG_ARM_SCMI_TRANSPORT_VIRTIO=y
CONFIG_ARM_SCMI_TRANSPORT_VIRTIO_VERSION1_COMPLIANCE=y
# CONFIG_ARM_SCMI_TRANSPORT_VIRTIO_ATOMIC_ENABLE is not set
CONFIG_VIRTIO_BLK=y
CONFIG_SCSI_VIRTIO=y
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM_VIRTIO=y
# CONFIG_I2C_VIRTIO is not set
# CONFIG_GPIO_VIRTIO is not set
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_DRM_VIRTIO_GPU_KMS=y
CONFIG_VIRTIO_ANCHOR=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_PCI_LIB=y
CONFIG_VIRTIO_PCI_LIB_LEGACY=y
CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_MEM=y
CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_VIRTIO_DMA_SHARED_BUFFER=y
# CONFIG_VIRTIO_DEBUG is not set
CONFIG_VIRTIO_IOMMU=y
# CONFIG_RPMSG_VIRTIO is not set
CONFIG_VIRTIO_FS=y
# CONFIG_CRYPTO_DEV_VIRTIO is not set
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Top
Banana
Moderator
Moderator
User avatar
Posts: 2379
Joined: Fri May 21, 2004 12:02 pm
Location: Germany
Contact:
Contact Banana
Website

  • Quote

Post by Banana » Thu May 08, 2025 6:29 am

I've ditched the idea about virtualBox and using UTM now.
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Top
Post Reply
  • Print view

15 posts • Page 1 of 1

Return to “Gentoo on ARM”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic