oasislinux / oasis

a small statically-linked linux system
Other
2.75k stars 84 forks source link

Can't run Oasis Linux on QEMU 9 under Windows 10 #112

Open rosti-il opened 1 month ago

rosti-il commented 1 month ago

Just out of curiosity wanted to try Oasis Linux on QEMU 9 under Windows 10. I also have "Git for Windows" installed on that Windows 10 machine and that Git distribution also comes with MSYS2, Bash and a few other Linux tools.

So I downloaded the QEMU distribution of Oasis Linux from https://s3.sr.ht/builds.sr.ht/artifacts/~mcf/1138649/ff314f9e1f24ce4f/oasis-qemu.tar.xz as described at https://git.sr.ht/~mcf/oasis and tried to run it by ./run. QEMU on Windows doesn't support KVM so I removed the following line from the run script

    -enable-kvm -cpu host -m 2048 \

Then it started to boot but got stuck on the Linux init process stage because it uses some wrong path C:/Program to that init process, probably a truncated path to somewhere at C:\Program Files, most likely C:\Program Files\qemu.

image

I tried running qemu directly from /c/qemu and even tried placing this path as the very first one in the $PATH variable but nothing helped and the last message line in the stuck Oasis Linux boot is the same.

rosti-il commented 1 month ago

Finally I've found a workaround:

export MSYS2_ARG_CONV_EXCL="init="

This excludes the path passed into the init parameter to be converted by the MSYS2.

rosti-il commented 1 month ago

A few other workarounds that could be used instead of the previous one:

  1. use both single and double quotes to pass the $append into the -append argument of the qemu:
    -append "'$append'" \
  2. add an extra slash into beginning of the /bin/sinit path inside the append env variable:
    append="init=//bin/sinit root=/dev/vda ro TERM=$TERM"

    All three workarounds work independently. Not sure which one is the best. Probably the single with double quotes one.