How to use RSH/SSH Server in MINIX3.3 and Enable Screen Scrolling?

482 views
Skip to first unread message

Daniel Wang

unread,
May 4, 2017, 1:30:14 PM5/4/17
to minix3
Hi all,

I have a silly question to ask. I'm doing some security related experiments on MINIX3.3 and running MINIX3.3 VM in VMware. Everything runs well but it is not very convenient to debug through the tiny 80X24 screen. I would like to be able to scroll up and down on the screen.

1. I saw in the code base that RSHD is compiled under /usr/libexec/rshd. However, I cannot start it as a server and connect the MINIX VM from my Ubuntu through RSH. Does the RSH still supported, it so could you point me out how to setup the connection?

 2. A better solution it to use SSH of course, I know that I can probalby install SSH use pkg for X86, but I often rebuild the OS hence it is annoying to install SSH all the time, and the pkg is not supported on ARM (I use Beaglebone Black for testing). I think for long term I might try to add SSH in the /usr.bin OS codebase. I'm wondering has anyone did that before? Can SSH works on ARM? It would be great if someone can point me out some direction.

3. I also notice that in MINIX, SH has an key combination: SHIFT + CTRL + F3 that will enable Software/Hardware scrolling enabled, since my ultimate goal is to be able to trace more info on the screen I wonder how that function works in VM.

Thanks
-Dan   

Jean-Baptiste Boric

unread,
May 4, 2017, 3:12:17 PM5/4/17
to minix3
Hi,

I use QEMU to run MINIX 3. With the option -serial stdio for QEMU and console=tty00 for the boot command line, I can use the serial port as a console right inside the host terminal. The other virtual terminals on QEMU's window are still available if needed.

I haven't tried to make rsh work, but if you want to install ssh without downloading its packages every single time, you can bundle those packages with the image (but it hasn't been properly documented so far). Basically you bootstrap pkgsrc on the host to get pkg_info, download all packages and their dependencies inside a directory then you use the environment variables PKG_INFO, PACKAGES and PACKAGE_DIR to make that work. There's a pull request to improve that functionality (https://github.com/Stichting-MINIX-Research-Foundation/minix/pull/219), you probably want to merge it now to use both pkgin_cd and pkgsrc_cdimage.sh to make things easier.

r0ller

unread,
May 5, 2017, 3:02:49 AM5/5/17
to minix3
Hi Daniel,

I can only give you some hint concerning vmware as I'm using that too. If you have eclipse, you can install the RSE plugin (remote system explorer) and two TM add-in/extension ('Terminal View Remote System Explorer add-in' and 'Terminal via Remote API Connector Extensions' as they show up in my installation details). One of them gives you a pretty simple remote command shell (with echo) while the other one gives you a decent terminal but I can never recall which is which so I always have both:) With that you can logon to your minix in vmware and the scrolling issue is solved:)

Regards,
r0ller

David van Moolenbroek

unread,
May 5, 2017, 11:41:43 AM5/5/17
to minix3
Hello,

In addition to the previous answers..


On Thursday, May 4, 2017 at 7:30:14 PM UTC+2, Daniel Wang wrote:
1. I saw in the code base that RSHD is compiled under /usr/libexec/rshd. However, I cannot start it as a server and connect the MINIX VM from my Ubuntu through RSH. Does the RSH still supported, it so could you point me out how to setup the connection?

rshd should work, although it is arguably not the most well-tested part of MINIX. On MINIX 3.3.0 all the way through 3.4.0rc5, one must copy /etc/rc.daemons.dist to /etc/rc.daemons, optionally comment out or remove the lines other than the shell/rshd one, and reboot. On minix-current and all future images and releases, tcpd has been replaced by inetd; to start rshd, uncomment the "shell" lines in /etc/inetd.conf, and then issue "service inetd reload".

 2. A better solution it to use SSH of course, I know that I can probalby install SSH use pkg for X86, but I often rebuild the OS hence it is annoying to install SSH all the time, and the pkg is not supported on ARM (I use Beaglebone Black for testing). I think for long term I might try to add SSH in the /usr.bin OS codebase. I'm wondering has anyone did that before? Can SSH works on ARM? It would be great if someone can point me out some direction.

The OpenSSH distribution is part of the NetBSD base system (in crypto/external/bsd/openssh), which means that eventually we will want it in our base system as well. In essence, it must be imported with as few changes between the NetBSD and MINIX source trees as possible. If you are interested in pursuing that direction, zacts' NetBSD userland porting guide [1] should provide an excellent start. We would be very happy with a patch that does a proper import of OpenSSH, indeed not in the least because then it would also be immediately available on ARM.

3. I also notice that in MINIX, SH has an key combination: SHIFT + CTRL + F3 that will enable Software/Hardware scrolling enabled, since my ultimate goal is to be able to trace more info on the screen I wonder how that function works in VM.

As far as I know, that setting exists only to correct problems on certain ancient systems that come with a very particular expectation of how screen scrolling is done, and is not needed or in any way helpful in virtual environments. In fact it is fairly likely that MINIX no longer runs on any system on which that setting is relevant, so perhaps it should be removed. MINIX itself does not support proper console scrolling in any shape or form, and the TTY driver would have to be subjected to significant changes in order to support it.

Another option is to use tmux from the console. Then you can use tmux's scrolling facilities.

Regards,
David

Daniel Wang

unread,
May 6, 2017, 11:07:15 PM5/6/17
to minix3
Thank you David! I think I will start trying to port openssh from the BSD base system openssh into MINIX then in my spare time.

Thanks
-Dan 

Daniel Wang

unread,
May 6, 2017, 11:09:51 PM5/6/17
to minix3
Hi r0ller, could you give me more hints about how to use eclipse to run MINIX terminal? It sounds like a very good idea but I'm not sure what to do. Do you mean programming MINIX in Ecplise C++ and somehow use Eclipse to boot MINIX in VMware?

Thanks
-Dan

r0ller

unread,
May 8, 2017, 6:50:33 AM5/8/17
to minix3
Hi Daniel,

Sorry, I did not forget it but didn't have time yet. By the way, are you already an eclipse user or have never used it? None of them is a problem, just asking in order to know how detailed my answer should be;) I meant it exactly the way you wrote: working (coding) in eclipse on the minix files and compiling via the terminal. There used to be a wiki page describing this setup for minix (http://wiki.minix3.org/doku.php?id=developersguide:eclipsetutorial) but since the RSE and the terminal (TM) got splitted into two plugins, that wiki page helps no more. I guess I should update it after you manage to get your setup working...

Regards,
r0ller

r0ller

unread,
May 8, 2017, 6:56:35 AM5/8/17
to minix3
Hi again,

I've just had a look at the wiki page mentioned previously and actually, the RSE installation is still correct and it seems to describe setting up the ssh connection correctly. The only thing is that it does not tell anything about the full blown terminal plugin but it does mention the integrated/simpler one so you may give it a shot till I write a detailed answer on how to install the new TM plugin.

Regards,
r0ller

r0ller

unread,
May 8, 2017, 11:20:41 AM5/8/17
to minix3
Hi Daniel,

So, if you happen to be experienced with eclipse and know how to install a plugin, then this will already help -let me know if not, in any case:) I managed to find on the eclipse marketplace, which plugin gives you the full blown terminal: https://marketplace.eclipse.org/content/tm-terminal

Best regards,
r0ller

Daniel Wang

unread,
May 15, 2017, 3:37:05 PM5/15/17
to minix3
Thank you r0ller! I will test it.

Best 
-Dan

Chris Card

unread,
May 19, 2017, 7:48:18 AM5/19/17
to minix3
I dont know if it helps, but i can connect from linux to minix-vm, if I set hostname to localhost and then use network settings with bridge virtualbox, i also set sshd_config to port 22222. works fine
Reply all
Reply to author
Forward
0 new messages