Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Update instructions for testing in QEMU #189

Open
GBA-17 opened this issue Oct 2, 2020 · 12 comments
Open

Update instructions for testing in QEMU #189

GBA-17 opened this issue Oct 2, 2020 · 12 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@GBA-17
Copy link
Collaborator

GBA-17 commented Oct 2, 2020

Is your feature request related to a problem? Please describe.
The README instructions for testing in QEMU are currently out of date. We need to figure out the arguments for QEMU to locate the USB stick so that we can use the ISO cache.

Describe the solution you'd like
When we start up webboot in QEMU, we should be able to locate the USB stick containing the ISO cache.

Describe alternatives you've considered
One configuration we tried was:

qemu-system-x86_64 -m 2G -hda /dev/sda

This allowed us to boot into the kernel and initrd on the USB stick, but we couldn't access the USB stick once we booted into the u-root environment.

Additional context
N/A

@bjakobson
Copy link
Member

bjakobson commented Oct 28, 2020

Looks like the readme has been updated. Can we close the issue?

@GBA-17
Copy link
Collaborator Author

GBA-17 commented Oct 28, 2020

I don't think it's ready to close yet. We made a switch this summer from copying the ISO to pmem0 to accessing the ISO directly from a USB stick. The issue right now is that when we boot into U-root from QEMU, the USB stick doesn't show up in /dev. That keeps us from accessing the ISOs on the USB stick, and from testing Webboot.

@bjakobson
Copy link
Member

bjakobson commented Oct 28, 2020

When I was using syslinux, i found that my usb stuck was under /dev/sdb1 instead of /dev/sda. /sda was my VM. That is probably just because I had more devices, though.

@GBA-17
Copy link
Collaborator Author

GBA-17 commented Oct 28, 2020

Do you mean that there were multiple USB sticks plugged in? Like one USB stick had syslinux and the u-root stuff, and the other had files you wanted to access?

@bjakobson
Copy link
Member

Nope, just had my VM and my USB stick. Then using QEMU, I had to use /sdb1. Can you confirm that your current USB stick partition is /sda and not /sdb?

@GBA-17
Copy link
Collaborator Author

GBA-17 commented Oct 28, 2020

On my main Linux system, my USB stick is at /dev/sdb. What parameters are you using when you boot up QEMU?

@bjakobson
Copy link
Member

It's been a few months since I've tried it. I can find my commands

@bjakobson
Copy link
Member

I used @orangecms shell program to launch QEMU. run-webboot.sh

@orangecms
Copy link
Member

With the -hda, did you run a kernel that supports the necessary storage drivers? I can think of AHCI. It is different from the USB mass storage driver. And you will need to support the filesystem as well.

See also https://wiki.gentoo.org/wiki/QEMU/Options#Hard_drive

@bjakobson
Copy link
Member

I don't quite know. I ran your shell script, then selected "b" from the graphics option and then i was able to use webboot.

Bare in mind, this was probably 3 months ago 😀

@GBA-17
Copy link
Collaborator Author

GBA-17 commented Oct 29, 2020

Ok, good points about the shell script and AHCI.

I think I got it working with this command. Once QEMU started, I located the USB stick in u-root, and was able to use Webboot to boot into Tinycore.

qemu-system-x86_64 -m 2G -drive id=disk,file=/dev/sdb,if=none -device ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0

Except there's a few issues:

  • I copied and pasted from the link @orangecms shared, so I'm not totally sure what it all means
  • There's no network access. I think some of the parameters from the shell script would fix that, but I don't completely understand all the arguments there

@bjakobson
Copy link
Member

So /dev/sdb worked for you?

@orangecms will be able to give you a far better explanation about his shell script, but here is probably the most important line for wifi configuration:

'netdev user,id=network0 -device rtl8139,netdev=network0'

@rjoleary rjoleary added enhancement New feature or request help wanted Extra attention is needed labels Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants