wm: doc

ref: 2610d9c83090e53f615e1c877d581062a4da0d57
dir: /install.ms/

View raw version
# Install

please see <http://cloud9p.org/doc/vmm.html> instead of this document. 



![][1]

In /etc/vm.conf: 



    vm "username-plan9" {
            owner username
            memory 1024M
            cdrom "/home/iso/9front-8593.acc504c319a4b4188479cfa602e40cb6851c0528.amd64.iso"
            disk /home/username/username-plan9.qcow2 
            interface {
                    locked lladdr aa:bb:cc:dd:ee:ff
                    switch "switch0"
            }
    }
    

Download the plan9 ISO: 



    $ ftp http://9front.org/iso/9front-8593.acc504c319a4b4188479cfa602e40cb6851c0528.amd64.iso.gz
    $ doas mv 9front-8593.acc504c319a4b4188479cfa602e40cb6851c0528.amd64.iso.gz /home/iso/
    $ doas chown -R iso:iso /home/iso/
    $ cd /home/iso
    $ sha256 9front-8593.acc504c319a4b4188479cfa602e40cb6851c0528.amd64.iso.gz
    SHA256 (9front-8593.acc504c319a4b4188479cfa602e40cb6851c0528.amd64.iso.gz) = af6dfae894dcb1e43f1e7e3d085b50f6d1dcf396e09a37d23c174ea94d8bf244
    $ gunzip 9front-8593.acc504c319a4b4188479cfa602e40cb6851c0528.amd64.iso.gz
    

Create a user account and make sure to set the folder as go-rx: 



    $ doas chmod -R go-rx ~/
    $ doas su username
    

In the home folder: 



    $ vmctl create -s 20G ~/username-plan9.qcow2
    

Then log out of the user with ^D, then as admin user in group wheel: 



    $ doas vmctl reload
    $ doas vmctl start -c username-plan9
    Connected to /dev/ttypr (speed 115200)                                                  
    Boot failed: not a bootable disk                                                        
    
    *e820=1 0x0000000000000000 0x000000000009f800 2 0x000000000009f800 0x00000000000a0000 2 
    0x00000000000f0000 0x0000000000100000 1 0x0000000000100000 0x000000003fffc000 2 0x000000
    003fffc000 0x0000000040000000 2 0x00000000fffc0000 0x0000000100000000                   
    cdboot=yes                                                                              
    mouseport=ask                                                                           
    monitor=ask                                                                             
    vgasize=ask                                                                             
    bootfile=/386/9pc                                                                       
    >console=0                                                                              
    ccoonnssoollee==00
    
    >>bboooott
    
    bboooott
    
    
    Plan 9
    125 holes free
    0x00021000 0x0009f000 516096
    0x00100000 0x00110000 65536
    0x005dd000 0x19cc8000 426684416
    427266048 bytes free
    cpu0: 4600MHz GenuineIntel Xeon5000-series (AX 000206D7 CX 96982203 DX 079BA97F)
    ELCR: 02E8
    #l0: virtio: 1000Mbps port 0x2000 irq 5 ea f2b2b3daeb05
    i8042: kbd init failed
    1000M memory: 413M kernel data, 587M user, 1212M swap
    nusb/usbd: no hubs
    
    /dev/sd00: OpenBSD VMM CD-ROM 001
    /dev/sd00/data   9660
    /dev/sdF0:
    /dev/sdF0/data
    bootargs is (tcp, tls, il, local!device)[local!/dev/sd00/data] 
    user[glenda]: 
    
    init: starting /bin/rc
    cirno Sep 23 06:50:25 starting dns resolver on /net
    vgasize is (text, 640x480x8, 1024x768x16, ...) [1024x768x16] text
    bind: #i: no frame buffer
    init: rc exit status: rc 215: webcookies 330: interrupt
    
    init: starting /bin/rc
    % inst/start
    Thu Sep 23 04:51:42 CET 2021 Installation process started
    
    --------------------------------------
    
    Preparing menu...
    The following unfinished tasks are ready to be done:
            configfs        - choose the type of file system to install
            confignet       - configure the network
            tzsetup - choose time zone
    
    Task to do [configfs]: 
    
    --------------------------------------
    You can install the following types of file systems:
    
            cwfs64x the cached-worm file server
            hjfs    the new 9front file server (experimental!)
    
    File system (cwfs64x, hjfs)[cwfs64x]: hjfs
    
    --------------------------------------
    
    Preparing menu...
    The following tasks are done: 
            configfs        - choose the type of file system to install
    
    The following unfinished tasks are ready to be done:
            partdisk        - edit partition tables (e.g., to create a plan 9 partition)
            mountfs - choose and mount file system partition
            confignet       - configure the network
            tzsetup - choose time zone
    
    Task to do [partdisk]: 
    
    --------------------------------------
    The following disk devices were found.
    
    sd00 - OpenBSD VMM CD-ROM 001
       empty                0 485       (485 cylinders, 1.89 GB) 
     * p1                 485 486       (1 cylinders, 4.00 MB) ESP
    
    sdF0 -
    
    Disk to partition (sd00, sdF0)[no default]: sdF0
    The disk you selected HAS NO master boot record on its first sector.
    (Perhaps it is a completely blank disk.)
    Shall we create a blank EFI partition table (GPT)
    or install traditional DOS partition table (MBR)?
    
    Install mbr or gpt (mbr, gpt)[no default]: mbr
    
    This is disk/fdisk; use it to create a Plan 9 partition.
    If there is enough room, a Plan 9 partition will be
    suggested; you can probably just type 'w' and then 'q'.
    
    cylinder = 8225280 bytes
    '* p1                     0 2610        (2610 cylinders, 19.99 GB) PLAN9
    >>> w
    >>> q 
    
    --------------------------------------
    
    Preparing menu...
    The following tasks are done:                                                           
            configfs        - choose the type of file system to install
            partdisk        - edit partition tables (e.g., to create a plan 9 partition)
    
    The following unfinished tasks are ready to be done:                                    
            prepdisk        - subdivide plan 9 disk partition               
            mountfs - choose and mount file system partition                                
            confignet       - configure the network
            tzsetup - choose time zone
    
    Task to do [prepdisk]: 
    
    --------------------------------------
    The following Plan 9 disk partitions were found.
    
    /dev/sdF0/plan9
      empty                  0 41929587    (41929587 sectors, 19.99 GB)
    
    Plan 9 partition to subdivide (/dev/sdF0/plan9)[/dev/sdF0/plan9]: 
    This is disk/prep; use it to subdivide the Plan 9 partition.
    If it is not yet subdivided, a sensible layout will be suggested;
    you can probably just type 'w' and then 'q'.
    
    no plan9 partition table found
    9fat 204800
    nvram 1
    fs 41724786
    ' 9fat                   0 204800      (204800 sectors, 100.00 MB)
    ' nvram             204800 204801      (1 sectors, 512 B )
    ' fs                204801 41929587    (41724786 sectors, 19.89 GB)
    >>> w
    >>> q
    
    --------------------------------------
    
    Preparing menu...
    The following tasks are done: 
            configfs        - choose the type of file system to install
            partdisk        - edit partition tables (e.g., to create a plan 9 partition)
            prepdisk        - subdivide plan 9 disk partition
    
    The following unfinished tasks are ready to be done:
            mountfs - choose and mount file system partition
            confignet       - configure the network
            tzsetup - choose time zone
    
    Task to do [mountfs]: 
    
    --------------------------------------
    
    Please choose your hjfs partition
    
    --rw-r----- S 0 glenda glenda 21363090432 Jul 18 17:25 /dev/sdF0/fs
    
    Hjfs partition (/dev/sdF0/fs)[/dev/sdF0/fs]: 
    Size of RAM filesystem cache (MB)? [192]: 
    Ream the filesystem? (yes, no)[yes]: 
    Starting hjfs file server for /dev/sdF0/fs                                              
    hjfs: reaming /dev/sdF0/fs                                                              
    hjfs: ream successful                                                                   
    hjfs: fs is /dev/sdF0/fs          
    Configuring hjfs file server for /dev/sdF0/fs
    hjfs: >create /dist sys sys 775 d
    hjfs: >create /usr sys sys 775 d
    hjfs: >newuser glenda
    hjfs: >newuser adm +glenda
    hjfs: >newuser sys +glenda
    hjfs: >newuser upas +glenda
    hjfs: >echo off
    Mounting hjfs file server for /dev/sdF0/fs
    % mount -c /srv/hjfs.newfs /n/newfs
    
    --------------------------------------
    
    Preparing menu...
    The following tasks are done: 
            configfs        - choose the type of file system to install
            partdisk        - edit partition tables (e.g., to create a plan 9 partition)
            prepdisk        - subdivide plan 9 disk partition
            mountfs - choose and mount file system partition
    
    The following unfinished tasks are ready to be done:
            configdist      - choose the source of the distribution archive
            confignet       - configure the network
            tzsetup - choose time zone
    
    Task to do [configdist]: 
    
    --------------------------------------
    Are you going to download the distribution
    from the internet or do you have it on local media?
    
    Distribution is from (local, net)[local]: 
    
    --------------------------------------
    
    Preparing menu...
    The following tasks are done: 
            configfs        - choose the type of file system to install
            partdisk        - edit partition tables (e.g., to create a plan 9 partition)
            prepdisk        - subdivide plan 9 disk partition
            mountfs - choose and mount file system partition
            configdist      - choose the source of the distribution archive
    
    The following unfinished tasks are ready to be done:
            confignet       - configure the network
            mountdist       - locate and mount the distribution
            tzsetup - choose time zone
    
    Task to do [confignet]: 
    
    --------------------------------------
    
    We will configure the ethernet.
    
    
    Please choose a method for configuring your ethernet connection.
    
            manual - specify IP address, network mask, gateway IP address
            automatic - use DHCP and SLAAC to automatically configure
    
    Configuration method (manual, automatic)[automatic]: 
    starting ethernet automatic config                                                      
    ipconfig: write(try fe80::f0b2:b3ff:feda:eb05 /64): interface does not support multicast
    ipconfig: can't start IPv6 on /net/ether0, address fe80::f0b2:b3ff:feda:eb05
    ipconfig: dialicmp6: cs: can't translate address                                    
    
    --------------------------------------                                                  
    
    Preparing menu...                                                                       
    The following tasks are done:                                                           
            configfs        - choose the type of file system to install                     
            partdisk        - edit partition tables (e.g., to create a plan 9 partition)    
            prepdisk        - subdivide plan 9 disk partition                               
            mountfs - choose and mount file system partition                                
            configdist      - choose the source of the distribution archive                 
            confignet       - configure the network                                         
    
    The following unfinished tasks are ready to be done:                                    
            mountdist       - locate and mount the distribution                             
            download        - download or continue to download the distribution archives    
            tzsetup - choose time zone                                                      
    
    Task to do [mountdist]: 
    
    --------------------------------------
    Please wait... Scanning storage devices...
            /dev/sd00/data
            /dev/sdF0/9fat
            /dev/sdF0/data
            /dev/sdF0/fs
    
    The following storage media were detected.
    Choose the one containing the distribution.
    
            /dev/sd00/data (iso9660 cdrom)
    
    Distribution disk (/dev/sd00/data, /dev/sdF0/fs, /)[/]: 
    % mount /srv/boot /n/distmedia                                                          
    
    Which directory contains the distribution?                                              
    Any of the following will suffice (in order of preference):                             
            - the root directory of the cd image                                            
            - the directory containing 9front.iso                                           
            - the directory containing 9front.iso.bz2                                       
    
    Location of archives [/]:                   
    
    --------------------------------------
    
    Preparing menu...
    The following tasks are done: 
            configfs        - choose the type of file system to install
            partdisk        - edit partition tables (e.g., to create a plan 9 partition)
            prepdisk        - subdivide plan 9 disk partition
            mountfs - choose and mount file system partition
            configdist      - choose the source of the distribution archive
            confignet       - configure the network
            mountdist       - locate and mount the distribution
    
    The following unfinished tasks are ready to be done:
            copydist        - copy the distribution into the file system
            tzsetup - choose time zone
    
    Task to do [copydist]: 
    
    --------------------------------------                                                  
    processing /sys/lib/sysconfig/proto/allproto                                            
    file system made                                                              
    
    --------------------------------------
    
    Preparing menu...                           
    The following tasks are done:                                                           
            configfs        - choose the type of file system to install                     
            partdisk        - edit partition tables (e.g., to create a plan 9 partition)
            prepdisk        - subdivide plan 9 disk partition                           
            mountfs - choose and mount file system partition               
            configdist      - choose the source of the distribution archive
            confignet       - configure the network                        
            mountdist       - locate and mount the distribution         
            copydist        - copy the distribution into the file system
    
    The following unfinished tasks are ready to be done: 
            ndbsetup        - setup network configuration               
            tzsetup - choose time zone                                                      
            bootsetup       - configure hard disk to boot plan 9
    
    Task to do [ndbsetup]:  
    
    --------------------------------------
    
    Setup network configuration
    
    sysname [cirno]: username.example.com
    
    --------------------------------------
    
    Preparing menu...
    The following tasks are done: 
            configfs        - choose the type of file system to install
            partdisk        - edit partition tables (e.g., to create a plan 9 partition)
            prepdisk        - subdivide plan 9 disk partition
            mountfs - choose and mount file system partition
            configdist      - choose the source of the distribution archive
            confignet       - configure the network
            mountdist       - locate and mount the distribution
            copydist        - copy the distribution into the file system
            ndbsetup        - setup network configuration
    
    The following unfinished tasks are ready to be done:
            tzsetup - choose time zone                                                      
            bootsetup       - configure hard disk to boot plan 9        
    
    Task to do [tzsetup]: 
    
    --------------------------------------                                                  
    
    Setup Time Zone                                                                         
    
    Time Zone (Argentina, Asia_Bahrain, Asia_India, Australia_ACT, Australia_Broken-Hill, Au
    stralia_LHI, Australia_NSW, Australia_North, Australia_Queensland, Australia_South, Aust
    ralia_Sturt, Australia_Tasmania, Australia_Victoria, Australia_West, Australia_Yancowinn
    a, Brazil_Acre, Brazil_DeNoronha, Brazil_East, Brazil_West, CET, Canada_Atlantic, Canada
    _Central, Canada_East-Saskatchewan, Canada_Eastern, Canada_Mountain, Canada_Newfoundland
    , Canada_Pacific, Canada_Yukon, Chile_Continental, Chile_EasterIsland, Cuba, EET, Egypt,
     GB-Eire, GMT, HST, Hongkong, Iceland, Iran, Israel, Jamaica, Japan, Libya, Mexico_BajaN
    orte, Mexico_BajaSur, Mexico_General, NZ, NZ_CHAT, Navajo, PRC, Poland, ROC, ROK, Singap
    ore, Turkey, US_Alaska, US_Arizona, US_Central, US_East-Indiana, US_Eastern, US_Hawaii, 
    US_Michigan, US_Mountain, US_Pacific, US_Yukon, Uruguay, W-SU, WET)[US_Eastern]: US_Central
    
    --------------------------------------                                                  
    
    Preparing menu...                                                                       
    The following tasks are done:                                                           
            configfs        - choose the type of file system to install                     
            partdisk        - edit partition tables (e.g., to create a plan 9 partition)    
            prepdisk        - subdivide plan 9 disk partition                               
            mountfs - choose and mount file system partition                                
            configdist      - choose the source of the distribution archive          
            confignet       - configure the network
            mountdist       - locate and mount the distribution
            copydist        - copy the distribution into the file system
            ndbsetup        - setup network configuration
            tzsetup - choose time zone
    
    The following unfinished tasks are ready to be done:                                
            bootsetup       - configure hard disk to boot plan 9
    
    Task to do [bootsetup]:                                                                 
    
    --------------------------------------
    
    Setup Plan 9 FAT boot partition (9fat)                                        
    
    Plan 9 FAT partition (/dev/sdF0/9fat)[/dev/sdF0/9fat]: 
    dossrv: serving #s/dos                                                        
    % dd -bs 512 -count 1 -if /dev/sdF0/9fat -of /tmp/pbs.bak
    1+0 records in                                                                
    1+0 records out
    Initializing Plan 9 FAT partition.                                            
    % disk/format -r 2 -d -b /n/newfs/386/pbs -l PLAN9 /dev/sdF0/9fat
    Initializing FAT file system
    type hard, 12 tracks, 255 heads, 63 sectors/track, 512 bytes/sec
    used 4096 bytes
    % mount -c /srv/dos /n/9fat /dev/sdF0/9fat
    % rm -f /n/9fat/9bootfat /n/9fat/plan9.ini /n/9fat/9pc
    % cp /n/newfs/386/9bootfat /n/9fat/9bootfat
    % chmod +al /n/9fat/9bootfat
    % cp /tmp/plan9.ini /n/9fat/plan9.ini
    % cp /n/newfs/386/9pc /n/9fat/
    % mkdir -p /n/9fat/efi/boot
    % cp /386/bootia32.efi /386/bootx64.efi /n/9fat/efi/boot
    % cp /tmp/pbs.bak /n/9fat
    % unmount /n/9fat
    
    If you use the Windows NT/2000/XP master boot record
    or a master boot record from a Unix clone (e.g., LILO or
    FreeBSD bootmgr), it is probably safe to continue using
    that boot record rather than install the Plan 9 boot record.
    
    Install the Plan 9 master boot record (yes, no)[no default]: yes
    Mark the Plan 9 partition active (yes, no)[no default]: yes
    
    The Plan 9 partition is now marked as active.
    
    --------------------------------------
    
    Preparing menu...
    The following tasks are done: 
            configfs        - choose the type of file system to install
            partdisk        - edit partition tables (e.g., to create a plan 9 partition)
            prepdisk        - subdivide plan 9 disk partition
            mountfs - choose and mount file system partition
            configdist      - choose the source of the distribution archive
            confignet       - configure the network
            mountdist       - locate and mount the distribution
            copydist        - copy the distribution into the file system
            ndbsetup        - setup network configuration
            tzsetup - choose time zone
            bootsetup       - configure hard disk to boot plan 9
    
    The following unfinished tasks are ready to be done:
            finish  - finish the installation and reboot
    
    Task to do [finish]: 
    
    --------------------------------------
    Congratulations; you've completed the install.
    
    
    halting...halted at Thu Sep 23 05:46:49 2021.
    /srv/cwfs.newfs.cmd...
    done halting
    rebooting...
    cpu0: exiting
    Takes a licking and keeps on ticking...
    can't reset
    

At this point, plan9 is unable to reboot on its own, so type `~~.` then: 



    $ doas vmctl stop username-plan9
    $ doas vmctl start -c username-plan9
    



    Connected to /dev/ttyph (speed 115200)
    MBR...pbs.................ok
    *e820=1 0x0000000000000000 0x000000000009f800 2 0x000000000009f800 0x000000000
    00a0000 2 0x00000000000f0000 0x0000000000100000 1 0x0000000000100000 0x0000000
    03fffc000 2 0x000000003fffc000 0x0000000040000000 2 0x00000000fffc0000 0x00000
    00100000000                                                                   
    bootfile=9pc
    bootargs=local!/dev/sdF0/fs -m 192
    mouseport=ask
    monitor=ask
    vgasize=text
    ccoonnssoollee==00
    
    bboooott
    
    
    Plan 9
    126 holes free
    0x0001a000 0x0009f000 544768
    0x0060a000 0x0ffff000 262098944
    262643712 bytes free
    cpu0: 4623MHz GenuineIntel Xeon5000-series (AX 000206D7 CX 96982203 DX 079BA97
    F)
    ELCR: 02E8
    #l0: virtio: 1000Mbps port 0x2000 irq 5 ea de4baa668f07
    i8042: kbd init failed
    1024M memory: 256M kernel data, 767M user, 1392M swap
    nusb/usbd: no hubs
    
    /dev/sd00: OpenBSD VMM CD-ROM 001
    /dev/sd00/data   9660
    /dev/sdF0:
    /dev/sdF0/9fat   dos
    /dev/sdF0/data
    /dev/sdF0/fs     hjfs
    /dev/sdF0/nvram
    /dev/sdF0/plan9
    bootargs is (tcp, tls, il, local!device)[local!/dev/sdF0/fs -m 192] 
    user[glenda]: 
    hjfs: fs is /dev/sdF0/fs
    
    init: starting /bin/rc
    ipconfig: write(try fe80::dc4b:aaff:fe66:8f07 /64): interface does not support multicast
    ipconfig: can't start IPv6 on /net/ether0, address fe80::dc4b:aaff:fe66:8f07
    ipconfig: dialicmp6: cs: can't translate address
    bind: #i: no frame buffer
    rio: can't open display: initdisplay: /dev/draw/new: '/dev/draw' file does not exist
    init: rc exit status: rc 260: rio 396: display open
    
    init: starting /bin/rc
    % auth/wrkey
    bad nvram des key
    bad authentication id
    bad authentication domain
    authid: glenda
    authdom: username.example.com
    secstore key:                               
    password: 
    % 9fs 9fat
    % echo 'service=cpu' >> /n/9fat/plan9.ini
    % echo 'while() { sleep 5; ip/ping 38.87.162.1 > /dev/null } &' >> /bin/cpurc
    % fshalt -r
    

`~~.` to escape serial console, then: 



    host# vmctl stop username-plan9     
    stopping vm username-plan9: requested to shutdown vm 6
    host# vmctl start -c username-plan9 
    

To start VNC (optional): 



    # vncs -A /bin/rio -s

 [1]: https://wiki.ircnow.org/uploads/9/plan9-desktop.png