Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Run qemu-sparc and Solaris 2.6 in a docker container with networking and no additional privileges / capabilities required

NotificationsYou must be signed in to change notification settings

RetroHunGamer/docker-solaris

 
 

Repository files navigation

This is a dockerized SPARC Solaris 2.6 container which relies on QEMU's usermode networking and therefore requires no capabilities or additional privileges to work. Thissetup relies on no external volume mapping, and in theory it will work on a swarm.

Setup

You should now have a base image:

docker image lsREPOSITORY                           TAG        IMAGE ID       CREATED          SIZEqemu-sparc                           latest     08ec3475e3ec   23 minutes ago   1.89GB...
  • Add the ISO to it:

  • docker-compose run -v $(pwd)/iso:/mnt/iso sol cp /mnt/iso/solaris-2.6.iso /qemu/iso

  • docker-compose down

You should now have two new volumes:

 docker volume lsDRIVER    VOLUME NAME...local     docker-solaris_disklocal     docker-solaris_iso...
  • Start the container in pre-flight mode:
docker-compose up --no-startCreating network "docker-solaris_default" with the default driverCreating docker-solaris_sol_1 ... done

Now just switch to using thedocker command instead ofdocker-compose

  • Start the container:docker start docker-solaris_sol_1
  • Attach to the container:docker attach docker-solaris_sol_1

When you attach to it the PROM prompt will be waiting, hit enter in case you don't see anything and it should accept a blank line and give you a0 > prompt.

  • To detach from the docker container:control-p-q
  • When attached,control-a-c will switch between the QEMU monitor and the serial line, by default it's switched to the serial line when it first starts
docker attach docker-solaris_sol_10 > QEMU 5.2.0 monitor - type 'help' for more information <-- preessed control-a-c to switch to qemu monitor(qemu) info networkhub 0 \ hub0port2: lance.0: index=0,type=nic,model=lance,macaddr=52:54:00:12:34:56 \ port2: user0: index=0,type=user,net=10.0.0.0,restrict=off \ port1: socket0: index=0,type=socket,(qemu) info usernetHub 0 (user0):  Protocol[State]    FD  Source Address  Port   Dest. Address  Port RecvQ SendQ(qemu) <---- pressed control-a-c to switch back to serial line  ok0 > read escape sequence <---- pressed control-p-q and detached from the container ❯<----- bash prompt

Installing Solaris

By default this thing will try to boo from the hard disk image, and if it can't it will drop back to the PROM.

  • At the PROM boot prompt, typeboot cdrom:d -vs and hit enter:
docker attach docker-solaris-master_sol_1Configuration device id QEMU version 1 machine id 32Probing SBus slot 0 offset 0Probing SBus slot 1 offset 0Probing SBus slot 2 offset 0Probing SBus slot 3 offset 0Probing SBus slot 4 offset 0Probing SBus slot 5 offset 0Invalid FCode start byteCPUs: 1 x FMI,MB86904UUID: 00000000-0000-0000-0000-000000000000Welcome to OpenBIOS v1.1 built on May 4 2022 19:50  Type 'help' for detailed informationTrying disk:a...Trying disk...Not a bootable ELF imageNot a bootable a.out imageNo valid state has been set by load or init-program0 > boot cdrom:d Not a bootable ELF imageLoading a.out image...Loaded 7680 bytesentry point is 0x4000bootpath: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@2,0:dswitching to new context:SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0]Copyright (c) 1983-1997, Sun Microsystems, Inc.WARNING: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0 (sd0):corrupt label - wrong magic numberConfiguring devices...fdintr: nobody sleeping (c0 0 0)fdintr: nobody sleeping (c0 0 0)The system is coming up.  Please wait....Select a Language 0) English 1) German 2) Spanish 3) French 4) Italian 5) Swedish? 0Select a LocaleThe locale you select on this screen becomes the default displayedon your desktop after you reboot the system.  Selecting a localedetermines how online information is displayed for a specificlocale or region (for example, time, date, spelling, and monetary value.)NOTE: The ASCII only option gives you the default 128-character set thatwas available in previous releases.  If you do not need to send/receiveinternational correspondence where you need locale-specific alphabeticcharacters (like accented or umlaut characters) the ASCII only setis sufficient. Otherwise, you can select an ISO locale which containsa 256-character set.  Selecting an ISO locale can cause a minorperformance degradation (in many cases, less than 5%). 0) USA - English (ASCII only)         12) Lithuania 1) Czech Republic                     13) Latvia 2) Denmark                            14) Netherlands 3) Greece                             15) Netherlands/Belgium 4) Australia - English (ISO-8859-1)   16) Norway 5) Canada - English (ISO-8859-1)      17) Poland 6) Ireland - English ( 8 bit )        18) Portugal 7) New Zealand - English ( 8 bit )    19) Portugal/Brazil 8) UK - English (ISO-8859-1)          20) Russia 9) USA - English (ISO-8859-1)         21) Finland10) Estonia                            22) Turkey11) Hungary                            23) Go Back to Previous ScreenType a number and press Return or Enter [0]:...What type of terminal are you using? 1) ANSI Standard CRT 2) DEC VT52 3) DEC VT100 4) Heathkit 19 5) Lear Siegler ADM31 6) PC Console 7) Sun Command Tool 8) Sun Workstation 9) Televideo 910 10) Televideo 925 11) Wyse Model 50 12) X Terminal Emulator (xterms) 13) OtherType the number of your choice and press Return: 1...
  • If you're having trouble with the terminal, presscontrol-l (line feed) at any time to redraw the screen
- The Solaris Installation Program ---------------------------------------------  The Solaris installation program is divided into a series of short sections  where you'll be prompted to provide information for the installation. At  the end of each section, you'll be able to change the selections you've  made before continuing.  About navigation...        - The mouse cannot be used        - If your keyboard does not have function keys, or they do not          respond, press ESC; the legend at the bottom of the screen          will change to show the ESC keys to use for navigation.--------------------------------------------------------------------------------    Esc-2_Continue    Esc-6_Help
  • Hitescape_key-2
  • Follow the rest of the installer
  • IP address10.0.0.2
  • domain:localdomain
  • Nameserver (specify one)dunno for hostname (tab to the next field) specify4.2.2.1 for DNS
  • select yes system is part of a subnet
  • Specify255.255.240.0
  • It will fail, specifyno when prompted to enter new name service info
  • Go through the installer until you get to the partitioner
  • And it will drop you out to command line when it can't find a disk:
Exiting (caught signal 11)Type suninstall to restart.# format...format> typeAVAILABLE DRIVE TYPES:        0. Auto configure        1. Quantum ProDrive 80S        2. Quantum ProDrive 105S        3. CDC Wren IV 94171-344        4. SUN0104        5. SUN0207        6. SUN0327        7. SUN0340        8. SUN0424        9. SUN0535        10. SUN0669        11. SUN1.0G        12. SUN1.05        13. SUN1.3G        14. SUN2.1G        15. SUN2.9G        16. otherSpecify disk type (enter its number)[15]:
  • Save and quit
  • Runsuninstall
  • And the install begins
Preparing system for Solaris installConfiguring disk (c0t0d0)        - Creating Solaris disk label (VTOC)Creating and checking UFS file systems        - Creating / (c0t0d0s0)        - Creating /usr/openwin (c0t0d0s1)        - Creating /var (c0t0d0s3)...     Solaris Initial Install            MBytes Installed:     0.1818          MBytes Remaining:   419.36          Installing: TWS uoshX Window System & Graphics Runtime Library Links                              in /usr/lib          ||                     |           |           |           |           |          0          20          40          60          80         100...Solaris 2.6 software installation succeededCustomizing system files        - Mount points table (/etc/vfstab)        - Network host addresses (/etc/hosts)Customizing system devices        - Physical devices (/devices)fdintr: nobody sleeping (c0 0 0)fdintr: nobody sleeping (c0 0 0)        - Logical devices (/dev)Installing boot information        - Installing boot blocks (c0t0d0s0)Installation log location        - /a/var/sadm/system/logs/install_log (before reboot)        - /var/sadm/system/logs/install_log (after reboot)Installation completeExecuting SolStart postinstall phase...Executing finish script "patch_finish"...Checking installed packages and patches...QEMU 5.2.0 monitor - type 'help' for more information(qemu) info registerspc: f00645b0  npc: f00645b4%g0-7: 00000000 ef6c5b2c 00000000 0000040d 000010e0 00000000 00000000 00000000%o0-7: 00050c18 00000000 00000003 0009a7f0 0009269c 00000003 efffe508 00025bec%l0-7: 04000081 ef6865a8 ef6865ac 00000000 00000000 0000040d 000010e0 ef6c5b2c%i0-7: 00094460 0005bfdc 00000000 0a000000 00000000 0004e6cc efffe260 ef686424%f00:  ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff%f08:  ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff%f16:  ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff%f24:  ffffffffffffffff ffffffffffffffff ffffffffffffffff 0000000000000000psr: 04400081 (icc: -Z-- SPE: S--) wim: 00000001fsr: 00000000 y: 00000000(qemu) info registerspc: 0002571c  npc: 00025720%g0-7: 00000000 0004d400 00000000 18655444 7a476a38 00000000 00000000 00000000%o0-7: 0009a7f0 00000001 00000001 000a35c8 00000000 00008024 efffe008 00025714%l0-7: 00000050 00000000 00000000 00000000 000a4cf8 00000000 00000000 00000000%i0-7: 0009b290 0004e6f4 0004d6a6 0004d660 000a35c8 00000000 efffe098 00024d50%f00:  ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff%f08:  ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff%f16:  ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff%f24:  ffffffffffffffff ffffffffffffffff ffffffffffffffff 0000000000000000psr: 04400026 (icc: -Z-- SPE: --E) wim: 00000080fsr: 00000000 y: 00000000(qemu)Verifying sufficient filesystem capacity (dry run method)...Installing patch packages...Patch number 105570-01 has been successfully installed.See /a/var/sadm/patch/105570-01/log for detailsPatch packages installed:  SUNWrtvc  SUNWrtvclChecking installed packages and patches...Verifying sufficient filesystem capacity (dry run method)...Installing patch packages...Patch number 105633-05 has been successfully installed.See /a/var/sadm/patch/105633-05/log for detailsPatch packages installed:  SUNWxwcft  SUNWxwfnt  SUNWxwplt  SUNWxwslbChecking installed packages and patches...Executing prepatch script...Verifying sufficient filesystem capacity (dry run method)...Installing patch packages...Patch number 105654-03 has been successfully installed.See /a/var/sadm/patch/105654-03/log for detailsPatch packages installed:  SUNWcsrChecking installed packages and patches...Executing prepatch script...Verifying sufficient filesystem capacity (dry run method)...Installing patch packages......

This part just takes forever, why the disc shipped with patches RTM that weren't already applied is beyond me, but it needs to do it, and then it will auto-reboot:

Executing JumpStart postinstall phase...The begin script log 'begin.log'is located in /var/sadm/system/logs after reboot.The finish script log 'finish.log'is located in /var/sadm/system/logs after reboot.Mar 22 17:11:04 rpcbind: rpcbind terminating on signal.syncing file systems... donerebooting...rebooting ()Configuration device id QEMU version 1 machine id 32Probing SBus slot 0 offset 0Probing SBus slot 1 offset 0Probing SBus slot 2 offset 0Probing SBus slot 3 offset 0Probing SBus slot 4 offset 0Probing SBus slot 5 offset 0Invalid FCode start byteCPUs: 1 x FMI,MB86904UUID: 00000000-0000-0000-0000-000000000000Welcome to OpenBIOS v1.1 built on May 4 2022 19:50  Type 'help' for detailed informationTrying disk:a...Not a bootable ELF imageLoading a.out image...Loaded 7680 bytesentry point is 0x4000bootpath: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0:aswitching to new context:SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0]Copyright (c) 1983-1997, Sun Microsystems, Inc.Hostname: solarisConfiguring the /devices directoryfdintr: nobody sleeping (c0 0 0)fdintr: nobody sleeping (c0 0 0)Configuring the /dev directoryConfiguring the /dev directory (compatibility devices)The system is coming up.  Please wait.checking ufs filesystems/dev/rdsk/c0t0d0s1: is clean./dev/rdsk/c0t0d0s5: is clean./dev/rdsk/c0t0d0s7: is clean.Configuring network interface addresses: le0RPC: Timed outNIS domainname is localdomain...

and then after a bit you will be prompted to change the password:

On this screen you can create a root password.A root password can contain any number of characters, but only the first eightcharacters in the password are significant. (For example, if you create`a1b2c3d4e5f6' as your root password, you can use `a1b2c3d4' to gain rootaccess.)You will be prompted to type the root password twice; for security, the passwordwill not be displayed on the screen as you type it.> If you do not want a root password, press RETURN twice.Root password:Press Return to continue.

I set mine tocheese

System identification is completed.Setting netmask of le0 to 255.255.240.0Setting default interface for multicast: add net 224.0.0.0: gateway solarissyslog service starting.passwd.org_dir: Error in accessing NIS+ cold start file... is NIS+ installed?.group.org_dir: Error in accessing NIS+ cold start file... is NIS+ installed?.hosts.org_dir: Error in accessing NIS+ cold start file... is NIS+ installed?.Print services started.volume management starting.The system is ready.solaris console login: rootPassword:cheeseMar 22 20:14:54 solaris login: ROOT LOGIN /dev/consoleSun Microsystems Inc.   SunOS 5.6       Generic August 1997# ifconfig -alo0: flags=849<UP,LOOPBACK,RUNNING,MULTICAST> mtu 8232        inet 127.0.0.1 netmask ff000000le0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500        inet 10.0.0.2 netmask fffff000 broadcast 10.0.15.255        ether 52:54:0:12:34:56# ping 10.0.0.110.0.0.1 is alive# route add default 10.0.0.1add net default: gateway 10.0.0.1# 4.2.2.14.2.2.1 is alive

Networking

In addition to forwarding ports with docker/compose, however you do, (most people probably use the ports section though for me it's a little different) you also need to configure a port forwardfor the QEMU user net:

(qemu) help hostfwd_addhostfwd_add [netdev_id] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport -- redirect TCP or UDP connections from host to guest (requires -net user)(qemu) info usernetHub 0 (user0):  Protocol[State]    FD  Source Address  Port   Dest. Address  Port RecvQ SendQ(qemu) hostfwd_add user0 tcp:100.64.96.34:23-10.0.0.2:23(qemu) info usernetHub 0 (user0):  Protocol[State]    FD  Source Address  Port   Dest. Address  Port RecvQ SendQ  TCP[HOST_FORWARD]  11    100.64.96.34    23        10.0.0.2    23     0     0(qemu)
  • then you would just telnet to100.64.96.34 if that were the IP address of the container itself.

Networking with other Solaris containers

If you haven't figured this out the volumes can be copied and you can create as many containers as you want. The first containerthat you create bootstraps the user network, and additional containers you just need to change the env for the compose to matchsomething like this:

SOCKET_NET: connect=100.64.96.34:65534MAC: "de:ad:de:01:02:04"

Problems

  • Running on a Mac M1 at the moment doesn't work

About

Run qemu-sparc and Solaris 2.6 in a docker container with networking and no additional privileges / capabilities required

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile100.0%

[8]ページ先頭

©2009-2025 Movatter.jp