openbsd-sparc64-vm.html - www.codemadness.org - www.codemadness.org saait content files
 (HTM) git clone git://git.codemadness.org/www.codemadness.org
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       openbsd-sparc64-vm.html (4764B)
       ---
            1 <!DOCTYPE html>
            2 <html dir="ltr" lang="en">
            3 <head>
            4         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            5         <meta http-equiv="Content-Language" content="en" />
            6         <meta name="viewport" content="width=device-width" />
            7         <meta name="keywords" content="OpenBSD, SPARC64, QEMU, vm" />
            8         <meta name="description" content="Setup an OpenBSD SPARC64 VM in QEMU" />
            9         <meta name="author" content="Hiltjo" />
           10         <meta name="generator" content="Static content generated using saait: https://codemadness.org/saait.html" />
           11         <title>Setup an OpenBSD SPARC64 VM in QEMU - Codemadness</title>
           12         <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
           13         <link rel="stylesheet" href="print.css" type="text/css" media="print" />
           14         <link rel="alternate" href="atom.xml" type="application/atom+xml" title="Codemadness Atom Feed" />
           15         <link rel="alternate" href="atom_content.xml" type="application/atom+xml" title="Codemadness Atom Feed with content" />
           16         <link rel="icon" href="/favicon.png" type="image/png" />
           17 </head>
           18 <body>
           19         <nav id="menuwrap">
           20                 <table id="menu" width="100%" border="0">
           21                 <tr>
           22                         <td id="links" align="left">
           23                                 <a href="index.html">Blog</a> |
           24                                 <a href="/git/" title="Git repository with some of my projects">Git</a> |
           25                                 <a href="/releases/">Releases</a> |
           26                                 <a href="gopher://codemadness.org">Gopherhole</a>
           27                         </td>
           28                         <td id="links-contact" align="right">
           29                                 <span class="hidden"> | </span>
           30                                 <a href="feeds.html">Feeds</a> |
           31                                 <a href="pgp.asc">PGP</a> |
           32                                 <a href="mailto:hiltjo@AT@codemadness.DOT.org">Mail</a>
           33                         </td>
           34                 </tr>
           35                 </table>
           36         </nav>
           37         <hr class="hidden" />
           38         <main id="mainwrap">
           39                 <div id="main">
           40                         <article>
           41 <header>
           42         <h1>Setup an OpenBSD SPARC64 VM in QEMU</h1>
           43         <p>
           44         <strong>Last modification on </strong> <time>2020-04-18</time>
           45         </p>
           46 </header>
           47 
           48 <p>This describes how to setup an OpenBSD SPARC64 VM in QEMU.</p>
           49 <h2>Create a disk image</h2>
           50 <p>To create a 5GB disk image:</p>
           51 <pre><code>qemu-img create -f qcow2 fs.qcow2 5G
           52 </code></pre>
           53 <h2>Install</h2>
           54 <p>In this guide we'll use the installation ISO to install OpenBSD. Make sure to
           55 download the latest (stable) OpenBSD ISO, for example install62.iso.</p>
           56 <ul>
           57 <li>Change -boot c to -boot d to boot from the CD-ROM and do a clean install.</li>
           58 <li>Change -cdrom install62.iso to the location of your ISO file.</li>
           59 <li>When the install is done type: halt -p</li>
           60 <li>Change -boot d back to -boot c.</li>
           61 </ul>
           62 <p>Start the VM:</p>
           63 <pre><code>#!/bin/sh
           64 LC_ALL=C QEMU_AUDIO_DRV=none \
           65 qemu-system-sparc64 \
           66         -machine sun4u,usb=off \
           67         -realtime mlock=off \
           68         -smp 1,sockets=1,cores=1,threads=1 \
           69         -rtc base=utc \
           70         -m 1024 \
           71         -boot c \
           72         -drive file=fs.qcow2,if=none,id=drive-ide0-0-1,format=qcow2,cache=none \
           73         -cdrom install62.iso \
           74         -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-1,id=ide0-0-1 \
           75         -msg timestamp=on \
           76         -serial pty -nographic \
           77         -net nic,model=ne2k_pci -net user
           78 </code></pre>
           79 <p>The VM has the following properties:</p>
           80 <ul>
           81 <li>No audio.</li>
           82 <li>No USB.</li>
           83 <li>No VGA graphics: serial console.</li>
           84 <li>Netdev is ne0 (Realtek 8029).</li>
           85 <li>1024MB memory.</li>
           86 </ul>
           87 <p>From your host connect to the serial device indicated by QEMU, for example:</p>
           88 <pre><code>(qemu) 2017-11-19T15:14:20.884312Z qemu-system-sparc64: -serial pty: char device redirected to /dev/ttyp0 (label serial0)
           89 </code></pre>
           90 <p>Then you can use the serial terminal emulator <strong>cu</strong> to attach:</p>
           91 <pre><code>cu -l /dev/ttyp0
           92 </code></pre>
           93 <p>Another option could be using the <a href="https://git.suckless.org/st/">simple terminal(st)</a> from suckless.</p>
           94 <pre><code>st -l /dev/ttyp0
           95 </code></pre>
           96 <p>using cu to detach the <a href="https://man.openbsd.org/cu#~^D">cu(1) man page</a> says:</p>
           97 <pre><code>Typed characters are normally transmitted directly to the remote machine (which
           98 does the echoing as well).  A tilde ('~') appearing as the first character of a
           99 line is an escape signal; the following are recognized:
          100 
          101     ~^D or ~.  Drop the connection and exit.  Only the connection is
          102                the login session is not terminated.
          103 </code></pre>
          104 <p>On boot you have to type:</p>
          105 <pre><code>root device: wd0a
          106 for swap use the default (wd0b) Press enter
          107 </code></pre>
          108 <h2>Initial settings on first boot (optional)</h2>
          109 <p>Automatic network configuration using DHCP</p>
          110 <pre><code>echo "dhcp" &gt; /etc/hostname.ne0
          111 </code></pre>
          112 <p>To bring up the interface (will be automatic on the next boot):</p>
          113 <pre><code>sh /etc/netstart
          114 </code></pre>
          115 <p>Add a mirror to /etc/installurl for package installation. Make sure to lookup
          116 the most efficient/nearby mirror site on the OpenBSD mirror page.</p>
          117 <pre><code>echo "https://ftp.hostserver.de/pub/OpenBSD" &gt; /etc/installurl
          118 </code></pre>
          119 
          120                         </article>
          121                 </div>
          122         </main>
          123 </body>
          124 </html>