メモのページ - チラシの裏メモ 3枚目

通信技術や気になった事を黙々とメモし続ける

AT&T UNIX System V Release 4を試用する

UNIXライクなOSではなく、純然たるUNIXをVirtualBoxで動かす事は可能なのだろうか。
今使用しているMacBook Airで動作しているmacOSは一応UNIXだし、VirtualBoxではAlpine LinuxやOpenBSD等UNIXライクなOSが動作しているが、そうではなくて自分が若かった頃に稼働していたUNIXのCLIに触れてみたいと思い、GoogleやYouTubeで検索してみた。

WindowsのアプリとしてUNIXを動かすのであれば、以下のリンク先に古いNetBSDやLinuxに混ざって386BSDや4.xBSDが公開されている。
Ancient UNIX/BSD emulation on Windows Files
https://sourceforge.net/projects/bsd42/files/4BSD%20under%20Windows/v0.4/

上記のリンク先のものでも良いのだがVirtualBoxやVMware Workstation等のゲストOSとしてUNIXを動かしてみたかった為、UNIX System Vなどもっと詳細な単語でGoogleやYoutubeで検索した結果、以下がヒットした。
https://www.youtube.com/watch?v=6P57ukAtCGs Installation of Unix System V on VirtualBox
https://www.youtube.com/watch?v=xNNy1MlAGoM Installing Intel UNIX SVR4 2.0 (x86) under VirtualBox

今回はYouTube上記のページで紹介されている内容を参考に、個人で所有しているノートPCにUNIXをデプロイし少し遊んでみた。


AT&T UNIX System V Release 4 (SVR4)とは
AT&T UNIX System V (システム ファイブ)は1983年にリリースされた、商用のUNIXである。
今回触れるSVR4 ver 2.1(System V Release 4 version 2.1)は1991年にリリース。当バージョンはLinuxや*BSDや他の一般的なUNIXの機能の起源だった。
UNIX Systems Laboratories(USL)とSun Microsystems社の共同開発であり、SVR3と4.3BSD、XENIX、SunOSの技術を統合したものであった。
AT&T UNIX System V Release 4は、デスクトップのワークステーションよりも、大規模なマルチユーザ環境のシステムで多く採用された。


当方の環境
ホストOS:macOS 10.13.6 / MacBook Air 2011 / RAM: 4GB / CPU: Intel Core i7 1.8GHz
Oracle VirtualBox:6.1.36
ゲストOS:AT&T UNIX System V Release 4 Version 2.1


注意事項
・当バージョン(SVR4)はTCP/IPをサポートしているもののNICを認識させていない為、外部との通信は出来ない。
・外部との間で通信が出来ない状態、かつ早々に飽きた為、当記事の公開の段階では既にAT&T UNIX System Vを当方の環境より削除済み。
・当ページにて紹介したWindowsアプリやUNIXを導入および動作させた事による故障や損害につきましては、当ブログの著者は一切の責任を負いかねます。
あらかじめご了承ください。


AT&T UNIX System V Release 4 Version 2.1のデプロイ
1.イメージファイルの入手
作業開始前に、リリース当時の雰囲気(1991年/平成3年)を醸し出す為、YouTubeで当時の音楽を流す。
https://www.youtube.com/watch?v=OqvGapuu95k 1991年ヒット曲ランキングトップ50
 
以下のリンク先よりAT&T UNIX System V Release 4 Version 2.1 (3.5).7zをダウンロード 。
ダウンロード完了後、ファイルを展開すると大量の.imgファイル(フロッピーディスクのファイル)が現れる。
https://winworldpc.com/product/att-system-v-unix/2-x
 
2.VirtualBoxの設定
上記のリンク先「Installation of Unix System V on VirtualBox」の内容を踏襲している。
[General]欄内のTypeやVersionは何でもよい。
[Storage]欄内のフロッピーディスクは、起動ディスク「Base 01 (2 User System).img」を指定する。
仮想HDDの容量は500MB、vmdkフォーマットにした。

[General]
Name:AT&T System V Rel4 ver2.1
Type:IBM OS/2
Version:OS/2 Warp 3

[System]
Base Memory:48MB
Processors:1
Boot Order:Floppy,Hard Disk

[Display]
Video Memory:16MB
Graphics Controller:VMSVGA
Remote Desktop Server:Disabled
Recording:Disabled

[Storage]
Controller:Floppy
Floppy:Base 01 (2 User System).img
Controller:IDE
IDE Primary Device 0:unix.vmdk

[Audio]
Disabled

[Network]
Adapter 1
Attached to: NAT
Adapter Type: PCnet-PCI II (Am79C970A)

[Ports]
Serial Ports:無効
USB:無効

上記の設定を終えたらOKをクリックし、VirtualBoxの設定を完了させる。


3.AT&T UNIX System Vのインストーラの起動
VirtualBoxのウインドウ内右上にある右矢印ボタンをクリックし、インストーラを起動させる。
仮想フロッピーディスクが仮想HDDより先に起動する設定となっている為、Base 01 (2 User System).imgが最初に読み込まれる。

total real memory             = 49934336
total available memory        = 47869952

AT&T UNIX System V/386 Release 4.0 Version 2.1

Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T
Copyright (c) 1987, 1988 Microsoft Corp.
All Rights Reserved

Ram Disk Driver,Copyright (c) 1986, 1987, 1988, 1989 Intel Corl.
RAM Disk 0 Allocated: size= 1185Kb
RAM Disk 1 Allocated: size= 512Kb

         Portions Copyright (c) 1990 Intel Corporation.
         All Rights Reserved

Please insert the UNIX System "Base System Package"
Floppy Disk 2 and then strike ENTER.

上記のようにPlease insert the UNIX System "Base System Package"と"Floppy Disk 2 and then strike ENTER."が出力されたら、
VirtualBoxの仮想マシンのウインドウ枠にあるフロッピーディスクのアイコンをクリックし、Choose a disk file...を選択。
Base 02.imgを選択し、Enterキーを叩く。

Please strike ENTER to install the UNIX System
on your hard disk or DEL to cancel the installation.

上記が出力されたら、Enterキーを叩いてインストールを進める。

WARNING: A new installation of the UNIX System will destroy
all files currently on the system. Do you with to continue (y or n)?

上記のcurrently on the systemとは当環境ではホスト機側のHDDのシステムではなく、VirtualBoxのゲスト機のシステムを指す。
よってここではyキーを叩く。

If you with to use part of your hard disk for
other operating system(s) other than the UNIX System,
such as MS-DOS, that space MUST be reserved now.
You are about to partition hard disk 0.
Please strike ENTER when ready or DEL to cancel the installation.

VirtualBoxで作成したゲスト機のHDDはまっさらな状態である為、このままインストールを進めても問題無し。
よってEnterキーを叩く。

The recommended default partitioning for your disl is:

   a 100% "UNIX System" partition.

To select this, please type "y". To partition your disk
differently, type "n" and the "fdisk" program will let you
select other partition.

ゲスト機のHDDの全ての領域を使用する為、yキーを叩く。

Hard disk partitioning complete.
The following hard disk elements are required and
must reside on your primary (disk 0) hard disk:
Drive     Name                Type    File System/Slice
-----     -----------------   ----    -----------------
0         Boot File System    bfs     /stand
0         Swap Slice                  /dev/swap
0         Root File System    ufs, s5 /

Please select the File System Type for / (Root File System) from
the following list:
               ufs, s5
Please press ENTER for the default type, ufs.

Do you with to create any optional
disk slices or filesystems (y or n)?

ルートディレクトリ / をインストールするか聞かれる。
インストーラが勧める内容で進める為、Enterキーを叩く。
この後 Do you with to create any optional disk slices or filesystems (y or n)?と聞かれる。yキーを叩く。

Do you with to install /usr (y or n)?

すると/usrをインストールするか聞かれる。今回は/の中に含める為、nキーを叩く。

The Hard disk layout you have selected is:

Drive     Name                Type    File System/Slice
-----     -----------------   ----    -----------------
0         Boot File System    bfs     /stand
0         Swap Slice          -       /dev/swap
0         Root File System    ufs     /

Is this correct (y or n)?

今回は上記のパーティションで進める為、yキーを叩く。

Surface analysis will now be performed on your hard disk and
UNIX System file systems will be created on your hard disk.
This will overwrite all data in the UNIX System partition.
Please strike ENTER to continue or DEL to cancel the installation.

念には念を押してHDDがUNIXに上書きされるけどいいか?と聞かれるが、VirtualBoxのゲストOSの話につき問題無い為、Enterキーを叩く。

Checking for bad sectors in the UNIX System partition...

Checking cylinder: 840

HDDの検査が開始する。

The following slice sizes are recommended configuration for your disk.
A / filesystem of 905 cylinders (445 MB)
A /dev/swap slice of 98 cylinders (48 MB)
A /stand filesystem of 11 cylinders (5 MB)

Is this configuration acceptable? (y/n)

HDDの検査の結果問題が無ければ、上記のようにパーティションの設定が開始する。
各パーティションに対し自動でサイズが割り当てられる。
問題無ければ yキーを叩いて割り当てられたサイズを反映させる。

Filesystems will now be created on the needed slices
Creating the / filesystem on /dev/rdisk/0s1
Creating the /stand filesystem on /dev/rdisk/0s10

UNIX System lost+found directories will now be created on your hard disk ...

UNIX System file system(s) have been created in your active UNIX System partition.

A UNIX System will now be installed on your hard disl ...........
Please standby.

When you are prompted to reboot your system,
remove the floppy disk from the diskette drive,
and strike CTRL-ALT-DEL.
Please wait for the prompt.

Reboot the system now.

UNIXシステムのインストールは正常に行われたようで、フロッピーディスクを抜いて再起動させて下さいとの事。
VirtualBoxの仮想マシンのウインドウ枠にあるフロッピーディスクのアイコンをクリックし、Remove disk from virtual driveをクリック。
その後、VirtualBoxのウインドウ内左上のMachineからResetをクリックし、再起動させる。
今度はUNIXがHDD(勿論、VirtualBoxのゲストOSのHDD)から起動する。

total real memory             = 49934336
total available memory        = 47869952

AT&T UNIX System V/386 Release 4.0 Version 2.1

Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T
Copyright (c) 1987, 1988 Microsoft Corp.
All Rights Reserved

Ram Disk Driver,Copyright (c) 1986, 1987, 1988, 1989 Intel Corl.
RAM Disk 0 Allocated: size= 1185Kb
RAM Disk 1 Allocated: size= 512Kb

         Portions Copyright (c) 1990 Intel Corporation.
         All Rights Reserved

Confirm

Please indicate the installation medium you intend to use.

Strike "C" to install from CARTRIDGE TAPE
or "F" to install from FLOPPY DISKETTE.

Srtrike ESC to stop.

この後もインストール作業が続くが、何を使ってインストールするか聞かれる。(Tape or Floppy)
今回はフロッピーディスクでインストールする為、Fキーを叩く。

Please insert the UNIX System "Base System Pakcage"
Floppy Disk 3 of 10 and then strike ENTER.

仮想マシンのウインドウ枠にあるフロッピーディスクのアイコンをクリックし、Choose a disk file...を選択。
Base 03.imgを選択し、Enterキーを叩く。

Installation is in progress -- do not remove the floppy disk.

Please insert the UNIX System "Base System Pakcage"
Floppy Disk 4 of 10 and then strike ENTER.

上記が出力されたら、仮想マシンのウインドウ枠にあるフロッピーディスクのアイコンをクリックし、Choose a disk file...を選択。
今度はBase 04.imgを選択し、Enterキーを叩く。

Installation is in progress -- do not remove the floppy disk.

Please insert the UNIX System "Base System Pakcage"
Floppy Disk 5 of 10 and then strike ENTER.

上記が出力されたら、仮想マシンのウインドウ枠にあるフロッピーディスクのアイコンをクリックしC、hoose a disk file...を選択。
今度はBase 05.imgを選択し、Enterキーを叩く。
...このような流れで、Base 10.imgまで進める。

UNIX System files have been copied to the hard disk. It is now safe
to remove the floppy disk.  Additional system files will now be setup.
Please stand by...
System time is: Tue Oct 16 09:52:04 EDT 1990

Enter a password for the root or Super-user.

(Note: This password must be kept EXTREMELY secure):
New password:
Re-enter new password:

Base 10.imgまで読み込まれシステムがインストールされた後、フロッピーディスクを抜いても問題無い旨出力される。
その後、rootアカウントのパスワード設定を実施。

Enter a password for the 'install' user.

(Note: This password must be kept EXTREMELY secure,
       and should be different from the root password):
New password:
Re-enter new password:

続けて、installユーザのパスワード設定が求められる。
rootアカウントのパスワードを重複させてはいけないとの注意書き有り。

Enter a password for the 'install' user.

(Note: This password must be kept EXTREMELY secure,
       and should be different from the root password):
New password:
Re-enter new password:

更に、serviceユーザのパスワード設定が求められる。
rootアカウントのパスワードを重複させてはいけないとの注意書き有り。

Please enter a System Name for this system. This will set the "node" name
and the "system" name. This name will be used for uucp(1) and networking.
Enter System Name: 

ここで、システム名の設定を求められる。
今のLinuxや*BSDのホスト名のような文字列と考えて良い。

        The UNIX Operating System will now be rebuilt.
        This will take some time.  Please wait.

        The UNIX Kernel has been rebuilt.


The UNIX System installation process is now complete.

To install the Foundation Set Add-On packages,
use the "pkgadd" command from the UNIX System prompt.

Be sure the floppy drive is empty and strike CTRL-ALT-DEL to reboot
your newly configured UNIX System.
Reboot the system now.

システム名の設定後、UNIXの基本的なインストール作業は完了となる。
フロッピーディスクが抜かれている事を確認し、UNIXを再起動させる。
VirtualBoxの場合、VirtualBoxのウインドウ内左上のMachineからResetをクリックする事で再起動が出来る。

total real memory             = 49934336
total available memory        = 47869952

AT&T UNIX System V/386 Release 4.0 Version 2.1

Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T
Copyright (c) 1987, 1988 Microsoft Corp.
All Rights Reserved

Node: xxxxxx
Setting up new kernel environment
The system is comming up. Please wait.
The system is ready.


Welcome to the AT&T 386 UNIX System
System name: xxxxx

Console Login:

システムの再起動が完了し、ログイン可能な状態となる。
Node: とSystem name: には、上記で設定したシステム名が表示される。
この後はパッケージをインストールする為、ここではrootでログインする。
パスワードを入力するとYour password has expired. Choose a new oneが返ってくる為、ここでもrootアカウントのパスワードを設定する。

UNIX System V/386 Release 4.0 Version 2.1
xxxxx
Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T
Copyright (c) 1987, 1988 Microsoft Corp.
All Rights Reserved

/          :   Disk space:  422.71 MB of 473.25 MB available (96.67%).
/stand     :   Disk space:    4.56 MB of   5.41 MB available (84.27%).

Total Disk Space: 427.27 MB of 442.67 MB available (96.52%).

#

設定したパスワードでログイン出来た。
デプロイは正常に完了した。


4.パッケージのインストール
この後、機能を追加したい場合はフロッピーディスクからインストールする。
今回は例としてNetworking Support Utility Packageをインストール。
pkgadd -d diskette1コマンドを打ち、Networking Support Utility Packageのインストール作業を開始する。

# pkgadd -d diskette1

Insert diskette into Floppy Drive 1.
Type [go] when ready,
  or [q] to quit: go


Installation in progress.  Do not remove the diskette.


The following packages are available:
  1  dfs     DFS Utilities
             (i386) 4.0 2.1
  2  nsu     Networking Support Utilities
             (i386) 4.0 2.1
  3  rpc     Remote Procedure Call Utilities
             (i386) 4.0 2.1

Select package(s) you wish to process (or 'all' to process
all packages).  (default: all) [?,??,q]: all

Networking Support Utility Packageには3つのパッケージが収録されている事が分かる。
今回は3つ全てインストールする。よってallを入力しEnterキーを叩く。

Processing package instance <nsu> from <diskette1>

Networking Support Utilities
Version 4.0 2.1 (i386)
AT&T-SF

Enter the number of pseudo-terminal devices to configure on your system.
(default: 16) [0-256,?,q] 16

Networking Support Utility Packageのインストールの過程でpseudo-terminal devicesの数を聞かれたが、今回はデフォルト値の16を入力しEnterキーを叩く。
インストールが開始され、更に別のフロッピーディスクの挿入を求められるが、Networking Support Utility Package.imgは1枚しか無い為、qを入力しインストールを終わらせる。

このような感じで、pkgadd -d diskette1コマンドを使うとパッケージのインストールが可能である。
自分の場合、以下のパッケージをインストールした。
・Editing Utilities.img:viエディタなどファイル編集ツール
・Networking Support Utility Package.img:ネットワークの管理ツール
・OA&M Basic & Ext.1.img:運用、保守、基本的なシステム
・OA&M Basic & Ext.2.img:運用、保守、基本的なシステム
・OA&M Basic & Ext.3.img:運用、保守、基本的なシステム
・FMLI Package.img:AT&T Form and Menu Language Interpreter
尚、OA&M Basic & Ext.1〜3.imgとFMLI Package.imgのインストール後、sysadmコマンドを打つと簡易的なシステム管理ツールが立ち上がる。


その他
・デフォルトで使用可能なエディタはviではなくedである。viを使用したい場合は、Editing Utilitiesのインストールが必要である。インストール方法は上記の「4.パッケージのインストール」を参照。
・当作業で生成されたvmdkファイルをqcow2ファイルに変換する事で、Androidスマホやタブレットのアプリ Limbo PC EmulatorのゲストOSとして動かす事が可能である。
・システムをシャットダウンさせる際、shutdown -h nowだと弾かれる。shutdown -y -g0を使用する。勿論、shutdownの前にsyncコマンドを実行する。(シングルユーザーモードに移行してからsyncコマンドを実行、という流れも有ったような気がする。)
・以下の画像。UNIX(macOS)の中でUNIX(SVR4)が動いている。


参照サイト、その他
https://en.wikipedia.org/wiki/UNIX_System_V
https://ja.wikipedia.org/wiki/UNIX_System_V
https://minnie.tuhs.org/cgi-bin/utree.pl The UNIX Tree (ソースコード)
http://man.cat-v.org/unix_7th/ UNIX V7 マニュアル

https://www.youtube.com/watch?v=6P57ukAtCGs& Installation of Unix System V on virtualbox
https://www.youtube.com/watch?v=gJx35Yc36Zc& AT&T UNIX/i386 SVR4 v3.0 (x86) running under VirtualBox
https://virtuallyfun.com/wordpress/ Fun with virtualization
https://qiita.com/gin_135/items/e16656a8fc461fd488ff UNIX V7を仮想マシン上で動かす手法のまとめ

https://winworldpc.com/product/att-system-v-unix/2-x WinWorld - AT&T System V Unix 2.x