Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linsk shell to access the filesystem? #35

Open
emanuele opened this issue Dec 8, 2024 · 5 comments
Open

linsk shell to access the filesystem? #35

emanuele opened this issue Dec 8, 2024 · 5 comments

Comments

@emanuele
Copy link

emanuele commented Dec 8, 2024

Is it possible to use linsk shell to access the Linux filesystem mounted via linsk? How?

@AlexSSD7
Copy link
Owner

AlexSSD7 commented Dec 8, 2024

Yes. Use linsk run --debug-shell.

@emanuele
Copy link
Author

emanuele commented Dec 15, 2024

Great, exactly what I needed! Thanks a lot @AlexSSD7 !

A follow-up question. Once in the shell, I installed vim via apk add vim, which worked well. But at the next use of linsk run --debug-shell ..., vim was not there anymore. Is apk add ... installation not persistent?

@AlexSSD7
Copy link
Owner

It is not. Every VM is created in an ad-hoc manner, being an inherent feature of Linsk. If you wish to add packages permanently, add desired package names to this line of code and rebuild the VM image.

@emanuele
Copy link
Author

Understood. Thanks.

Besides using linsk (which is great!), I am playing with qemu on macOS (silicon) trying to create a minimalistic linux vm with network support, hardware acceleration, etc. Alpine linux, or Debian, seem good candidates so, basically, it is akin to what you provide inside linsk - and possibly with persistence of the changes. I've read tutorials but they have heterogeneous/conflicting information and my experiments failed, so far. It would be great to have indications from you on how to proceed, given your expertise on the matter. Even more, I'd create a mini repo just for this, given the unclear information online - and I will when I'll succeed.

@AlexSSD7
Copy link
Owner

AlexSSD7 commented Dec 24, 2024

Take a look at vm/cfg.go#L59-L373. These are the helper functions that create QEMU flags for the Linsk VM. These are called in vm/vm.go#L107.

Also, as a tip for you, you can run a QEMU VM using a QEMU-based tool of choice and use ps aux | grep qemu-system to see what arguments the qemu-system command is called with, to use as a reference. QEMU man page can be very useful as well. It doesn't cover all flags and options; however, I would say that there is more than enough info for basic use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants