skiffos / SkiffOS

Any Linux distribution, anywhere.
https://skiffos.com
MIT License
685 stars 50 forks source link

virt/qemu: intel/x64: bash segfault when logging in with tty #275

Closed yokoyama-flogics closed 1 year ago

yokoyama-flogics commented 1 year ago

Hello,

First, thank you for your help with my question yesterday.

By your help, I could successfully make compile for intel/x64,virt/qemu. However, I experienced another problem as following.

FYI, I'm evaluating commit 5efaf68.

When I ran make cmd/virt/qemu/run, qemu-system (for x86_64) said it doesn't accept -machine virt. In addition, it also refused -bios default.

By removing the above two options, I could successfully launch SkiffOS on qemu.

However, I found yet another problem when trying to login by root. It didn't ask password (it means password is empty), but after the login, it showed login prompt again. I mean I can't get a shell prompt. Please refer below.

Welcome to SkiffOS 2022.11.1-98-g5efaf68a!
skiffos-5efaf68a login: [  136.736773] systemd-hostnam (500) used greatest stact

skiffos-5efaf68a login: root
Last login: Thu Mar  2 01:05:24 on ttyS0

Welcome to SkiffOS 2022.11.1-98-g5efaf68a!
skiffos-5efaf68a login:

I also tried SKIFF_CONFIG=intel/x64,virt/qemu,util/rootlogin but no luck. (I guess, virt/qemu automatically add util/rootlogin.

For your reference purpose, I will also attach kernel log. Sorry for the long post.

Any suggestion would be appreciated.

Regards,

Atsushi

paralin commented 1 year ago

Hi, thanks again for the report. It seems to me that bash is crashing after you log in.

@maxberger reported recently that bash was segmentation faulting on riscv, I wonder if that is related.

I'll test it out now and see if I can reproduce.

paralin commented 1 year ago

Reproduced the issue, working on a fix. Should be ready soon!

paralin commented 1 year ago

Hey @yokoyama-flogics it's fixed as of master dabaa628a8bbe1f57f652ef7695174cd2d978df5

You will need to recompile - before running "make configure" run "make clean" and select "y" for clearing the compiler cache as well.

Tested it with the configuration you provided and everything seems to be working now.

Unrelated, but I'd definitely recommend enabling Docker / skiff core:

# enable docker
export SKIFF_CONFIG=intel/x64,virt/qemu,apps/docker
# enable skiff core (docker + debian linux)
# you can access debian with "su - core"
export SKIFF_CONFIG=intel/x64,virt/qemu,skiff/core

Please feel free to let me know if you have any further difficulties & I'll re-open this.

Thanks again for testing!

yokoyama-flogics commented 1 year ago

@paralin ,

Thank you for the hard work! I pulled the latest update and now compiling the code. I also added skiff/core to the SKIFF_CONFIG.

Atsushi

yokoyama-flogics commented 1 year ago

@paralin ,

Now I could login to the SkiffOS on qemu! And also su - core ran successfully.

I will evaluate SkiffOS on qemu for a while. Thank you!!

Atsushi

paralin commented 1 year ago

@yokoyama-flogics good to hear! One last suggestion; id definitely recommend using ssh to access the VM instead of the serial terminal. The serial terminal has limited size and colors.

You can also enable the display by adjusting the qemu flags.

Best regards, Christian