Minix2 16bit ppp demo

From DOSBoxWiki
Jump to: navigation, search

DOSBox supports nullmodem connection using tcp sockets. In this page, we describe a simple networking slip configuration on linux (ubuntu) host, but for Minix 2.0.2 guest operating system. With socat or similar tools on host's side, you can connect these sockets with slattach, and the DOSBox guest can access internet as well.

WARNING!

The included script and manual is dangerous. It needs sudo or root access to the target host, uses external dependencies, can cause damage and irrecoverable package dependency problems via apt installing, and may be harmful when you are not familiar with tcp/ip ipv4 networking or linux iptables/slattach/etc. tools.

Prerequisities under ubuntu

Internet settings

A working internet connection is essential. 10.1.1.0/24 network must be unused! Otherwise network range collision will happen, causing unpredictable results!

Required ubuntu packages

The followings need to be installed:

apt-get install bash dosbox iptables socat sudo

The main script: minixbox.sh

The content of minixbox.sh:

#! /bin/bash
flushipt() {
  for i in $( iptables -t nat -n --line-numbers -L \
    | awk '/^Chain POSTROUTING/,/^$/{if(/^[0-9].*[^0-9]10\.1\.1\./)print $1}' | tac )
  do
    iptables -t nat -D POSTROUTING "$i"
  done
  for i in $( iptables -t nat -n --line-numbers -L \
    | awk '/^Chain PREROUTING/,/^$/{if(/^[0-9].*[^0-9]10\.1\.1\./)print $1}' | tac )
  do
    iptables -t nat -D PREROUTING "$i"
  done
if id -u | grep -q '^0'; then
  :
else
  echo 'dosbox slip deployment for minix2 guest'
  echo 'Author(s): Naszvadi Peter et al'
  echo
  echo "Please run $0 as root!"
  echo
  exit 1
fi
set -e
echo Checking necessary applications:
which dosbox
which iptables
which slattach
which socat
which sudo
which tac
set +e
flushipt
Dev_Pts="$(mktemp -u /tmp/slipXXX)"
socat PTY,link="$Dev_Pts",raw,echo=0 TCP-LISTEN:8040 &
Pid_Saved_3="$!"
sleep 1
Uid="$(find "$0" -printf '%U' -quit)"
sudo -u "#$Uid" dosbox -conf mnxslip.cnf &
Pid_Saved="$!"
grep -q 1 /proc/sys/net/ipv4/ip_forward || ( echo 1 1>/proc/sys/net/ipv4/ip_forward )
slattach -d -s 9600 -p adaptive "$Dev_Pts" 1>/dev/null 2>/dev/null &
Pid_Saved_2="$!"
sleep 3
ifconfig sl0 10.1.1.3 dstaddr 10.1.1.1 netmask 255.255.255.0 mtu 576 up 1>/dev/null 2>/dev/null
set -x
iptables -t nat -A POSTROUTING -s 10.1.1.0/24 -j MASQUERADE 1>/dev/null 2>/dev/null
set +x
while ps "$Pid_Saved" 1>/dev/null 2>/dev/null; do sleep 5
done 1>/dev/null 2>/dev/null
2>&-
kill -9 "$Pid_Saved_2" "$Pid_Saved_3" 1>/dev/null 2>/dev/null
flushipt
exit 0

The custom configuration file: mnxslip.cnf

The content of mnxslip.cnf:

[serial]
serial1=nullmodem server:localhost port:8040 transparent:1
[autoexec]
mount C .
C:
C:BOOT.COM PPP16

Launch a networked session under ubuntu

Creating working directory

Create a standalone folder, e.g. mkdir ~/minixslip

Creating files

Necessary files:

  • dosppp1615.zip
  • minixbox.sh
  • mnxslip.cnf

The latters should be saved from this site.

Set attributes of minixbox.sh:

chmod 755 minixbox.sh

Download and extract dosppp1615.zip: link and checksums at the bottom of this page

Till this, the above were the once time steps.

Launch ./minixbox.sh

Do it with sudo:

sudo ./minixbox.sh

If everything is okay, you can get similar results like these - setup slip in minix2 prompt after logging in with passwordless root account:

slip.drv -b 38400 -c -i 10.1.1.1 /dev/tty00 & echo nameserver 8.8.8.8 >/etc/resolv.conf

Press enters after entering command till getting command prompt back.

Dosbox minix2 slipsetup.gif

Applications

Telnet

Dosbox minix2 telnetbbs.gif

IRC client

Dosbox minix2 minirc.gif

Minix-specific

Graceful shutdown of guest in guest CLI:

# sync
# shutdown

Then type exit + ENTER at the appearing prompts!

Links