Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't chroot when installing amd64-openrc inside VMWare
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
stewie3128
n00b
n00b


Joined: 11 Aug 2023
Posts: 4

PostPosted: Sat Aug 12, 2023 12:05 am    Post subject: Can't chroot when installing amd64-openrc inside VMWare Reply with quote

I'm following the guide at https://wiki.gentoo.org/wiki/Apple_Silicon_VMware_Guide

when I run
Code:
chroot /mnt/gentoo /bin/bash

I get back an error message
Code:
chroot: failed to run command /bin/bash: Exec format error

Search results indicate that this is a 32bit/64bit problem, but the VMWare machine I've set up is "Debian 12.x 64-bit Arm." The problem also occurred when I tried doing the same thing inside an Ubuntu virtual machine.

I'm clearly getting something very basic wrong here, so from the beginning, here's what I'm doing:

Everything works until I get to the chroot stage.

Latest VMWare on a Mac Studio M1 Ultra

Just getting back into Linux after a few years away. Thanks so much!!!
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3918

PostPosted: Sat Aug 12, 2023 9:29 am    Post subject: Reply with quote

Welcome to Gentoo!
Quote:

but the VMWare machine I've set up is "Debian 12.x 64-bit Arm."

You cant chroot from arm to amd64.
Plz use an amd64 VM to chroot into amd64 Gentoo system.
If this is not possible then use an arm rootfs tarball of Gentoo.
_________________
:)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54578
Location: 56N 3W

PostPosted: Sat Aug 12, 2023 11:43 am    Post subject: Reply with quote

stewie3128,

Welcome to Gentoo

chrooting into amd64 from arm is possible but its slow as it requires qemu to emulate the target CPU at the register level in software.
Even though it's slow, it works.

Unless you really want to do that, set up a VM that matches your host.

The wiki page you reference says ...
Quote:
Go to the Gentoo downloads page and copy the link to the stage 3 tarball. MAKE SURE TO GET THE ARM64


arm64 <> amd64
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54578
Location: 56N 3W

PostPosted: Sat Aug 12, 2023 11:47 am    Post subject: Reply with quote

Moved from Installing Gentoo to Gentoo on ARM.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
stewie3128
n00b
n00b


Joined: 11 Aug 2023
Posts: 4

PostPosted: Sun Aug 13, 2023 5:58 pm    Post subject: Reply with quote

NeddySeagoon wrote:
stewie3128,

Welcome to Gentoo

chrooting into amd64 from arm is possible but its slow as it requires qemu to emulate the target CPU at the register level in software.
Even though it's slow, it works.

Unless you really want to do that, set up a VM that matches your host.

The wiki page you reference says ...
Quote:
Go to the Gentoo downloads page and copy the link to the stage 3 tarball. MAKE SURE TO GET THE ARM64


arm64 <> amd64


Thanks! I'm clearly back at noob status, per my profile :)
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 491

PostPosted: Wed Aug 16, 2023 1:38 pm    Post subject: Reply with quote

At the moment, I forget the exact why, but use Other 64-bit Arm. That is the setting I have in VMWare Fusion on an M1 Laptop for my working Gentoo VM's.

edit to add: Don't drag and drop the iso, instead use Create a Custom Virtual Machine. That will make the Other 64-bit Arm option available.


Last edited by flysideways on Wed Aug 16, 2023 2:21 pm; edited 2 times in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54578
Location: 56N 3W

PostPosted: Wed Aug 16, 2023 1:42 pm    Post subject: Reply with quote

stewie3128,

The kernel you share on IRC was missing EFI support and the was no console support at all.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
stewie3128
n00b
n00b


Joined: 11 Aug 2023
Posts: 4

PostPosted: Wed Aug 16, 2023 8:18 pm    Post subject: Reply with quote

NeddySeagoon wrote:
stewie3128,

The kernel you share on IRC was missing EFI support and the was no console support at all.


Thanks so much!
Back to top
View user's profile Send private message
stewie3128
n00b
n00b


Joined: 11 Aug 2023
Posts: 4

PostPosted: Thu Aug 24, 2023 11:59 pm    Post subject: It's working now Reply with quote

Finally came back to this little project. For reference, I'm using VMware Fusion 13.0.2 on a Mac Studio M1 Ultra running Ventura.

I was able to complete a fully-working minimal install, and am now emerging Gnome.

Installation of ARM64 Gentoo within VMWare on Apple Silicon isn't completely straightforward yet - it required a lot of searching, and some trial and error. I had to deviate quite a bit from the Apple Silicon VMware Guide...

One basic thing that should be corrected in there is to use
Code:
links https://www.gentoo.org/downloads/mirrors
instead of
Code:
wget <URL OF STAGE 3>
to fetch the tarball. It's much easier, because open-vm-tools (which provides copy-and-paste functionality with the host system, among other things) still isn't fully supported on ARM64.

I also noticed that https://mirror.leaseweb.com/gentoo/ isn't included in the mirrorselect program for some reason. It has been, for me in California, by far the fastest server.

The full COMMON_FLAGS line for this particular processor technically is
Code:
COMMON_FLAGS="-march=armv8.5-a -O2 -pipe"
But it looks like this particular -march isn't fully supported throughout the emergiverse yet, so just stick with
Code:
COMMON_FLAGS="-O2 -pipe"

It's worth noting that -pipe isn't included in their recommended make.conf file for some reason, but my install has been the easiest when including that option.

If you're going to use the CPU_FLAGS_ARM line in your make.conf file, be sure to add sha1 and sha2 to the flags that they list in the guide. I've had the best luck so far just hashing out that line though.

I found I needed to add elogind and dbus to my USE line in make.conf for some reason.

There were several VMWare elements that needed to be included in the kernel (if not for these, then a binary kernel would have sufficed) - basically everything that included the word VMware or VMX. Hit the / key inside menuconfig to search for things by flag or whatever.

EFI console and simple console also needed to be turned on.

The command that the Guide provides to make the kernel always failed for me - something to do with module install. To get around this, I installed it the old way:
Code:
make menuconfig #get the VMware graphics etc. installed directly, and enable EFI console and simple console
make
make modules
make modules_install
make install
Perhaps it's safe to put all of these together into
Code:
make && make modules && make modules_install && make install
...but I'm not sure.

Occasionally, unmounting at the end of the process was a pain.
Code:
umount -R /mnt/gentoo
was frequenly not enough to unmount.

In that even, exit out as far as you can go, then run
Code:
umount -l /mnt/gentoo/dev{/pts,/shm,}
umount -l /mnt/gentoo{/boot,/proc,}
Those should do it, but just to be sure, retry
Code:
umount -R /mnt/gentoo

There were frequent compile failures that looked really arcane and complicated. In those events, emerge the crashing package separately with "-j1" for both makeopts and emerge opts.

I'll post my working kernel config file once I finish emerging Gnome-light (another package/metapackage that has to be emerged -j1) one thread at a time. So far I've already had to break a circular Gnome dependency by running
Code:
USE="minimal" emerge -1 libsndfile

Thanks for all of the help so far!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum