WukLab/LegoOS

Accessing LegoOS via SSH

Boon-Jun opened this issue · 7 comments

Hello @lastweek.

I am currently trying to setup LegoOS, and I am wondering if it is easy to set up a SSH connection.
From the docs, it seems like it is possible to configure the output of LegoOS via a serial port, but are there best practices to send inputs as well if SSH does not work.

Thank you!

Hi @Boon-Jun,

I assume you are testing legoos on top of QEMU. Currently, the output go to serial port (i.e., ttys1 or ttys2). There is no way to send input via the qemu console yet, legoos serial driver does not have that part.

What you are trying to use SSH for? Are you trying to forward serial output to another machine via SSH?

Actually, I am trying to run LegoOS directly on the cloudlab r320 instance(on the physical machine itself). But I’m working through an intermediary and I do not have direct access to an operational shell. So I’m wondering if I can make an assumption that SSH will be available once LegoOS is installed for me to access the instance.

To add on, I’ve been trying the 1P-1M configuration, and after following the documentation, we are still unable to interact directly with LegoOS, although we do feel that we are really close.

The following are the logs we have obtained from the cloudlab console.
167-memory.txt
177-processor.txt

May I ask whether if I am on the right path to a successful boot according to the logs?

So I’m wondering if I can make an assumption that SSH will be available once LegoOS is installed for me to access the instance. no. Unfortunately, legoos does not have any ssh access, nor an operational shell.

It is running at one-shot mode: If you are using 1P-1M mode, you have to hard code the program you intend to run at pComp side and manually specify (link) the program at mComp side (you can do so via the .config file). Once P and M connects, it will automatically run that program.

Thank you for the reply @lastweek . After following your advice, I managed to run a program in 1P-1M recently.

On a similar topic, I tried running a program in 1P-1M with a binary large object that is 32MB in size embedded within, and trying to boot into the memory component of LegoOS in this manner resulted in a crash.

May I ask whether if there is a size limit to the ramfs of LegoOS in 1P-1M, and is there a way to circumvent/configure the limit?

May I ask whether if there is a size limit to the ramfs of LegoOS in 1P-1M, and is there a way to circumvent/configure the limit? Yes, the limitation comes from grub. In the 1P-1M model, the application ELF binary is built into the kernel image (vmImage). Grub2 cannot load big images larger than a certain size.

the only way is to use 1P-1M-1S setting, in which you can use arbitrary applications

Alright. That makes sense now.
I will try setting up in 1P-1M-1S & thank you for the help.