I've spent few hours today trying to figure out how to best set up a Minix v3.3.0 development machine on my Mac OS X 10.9.4 host with VirtualBox. After what is not less than 5 times of tearing down and setting back up the machine, I believe I have what is a good working version.
After you follow the guide and getting a minix machine to boot, first we install some goodies on our system which will be required later.
$ pkgin update
$ pkgin in vim openssh bash git-base clang binutils
Might take some time to install though.
Next, I need the source. I know I have build 588a35b, which apparently is also a git commit hash. Although in multiple versions of the docs, Minix says the source is under /usr/src by default, I just couldn't find it. So, below are the commands for obtaining the Minix3 source, putting them in the right place in the filesystem, and 'checking out' the build I'm currently running on. Again, the git clone may take some time to complete.
$ cd /usr
$ git clone git://github.com/minix3/minix src
$ git checkout 588a35b
The tty terminal environment was not really appealing to me, as I preferred my Mac's bash, so ideally I had to set up a way to ssh into my Minix virtual machine. To do that properly, here's what I did.
On the VirtualBox guest go to Settings > Network > Port Forwarding. Set any rule name, the host port to 2222 (or any port number > 1023 really), and the guest port to 22 (Do not touch the other fields, you want TCP, and the IP fields should be blank). Now in my configuration, the host to guest connection does not initially work because the Minix user root has no password set. To set a password, in the guest terminal (Minix) type:
Then go to the host shell. Now we will get a brand new RSA key, and load it onto the Minix box:
$ ssh-keygen -b 4096 -t rsa # when prompted for path to save, enter ~/.ssh/id_rsa_minix
$ ssh-add ~/.ssh/id_rsa_minix
$ scp -P 2222 ~/.ssh/id_rsa_minix.pub root@127.0.0.1/root/.ssh/id_rsa.pub
Here, you will need to enter the password you set in the previous step, when prompted.
Now go to the Minix guest terminal:
$ cd /root/.ssh
$ touch authorized_keys
$ cat id_rsa.pub >> authorized_keys
Now through the host, the following command should work, and you should get a nice SSH connection to your local Minix virtual box:
$ ssh -vp 2222 root@127.0.0.1
If all goes well, you have a Minix VirtualBox v3.3.0, which includes the source code, checked out to reflect current build. Furthermore, you can SSH into that virtual machine from the comfort of your host OS. Enjoy!