Skip to content

Instantly share code, notes, and snippets.

@citrus-it
Last active September 30, 2021 04:12
Show Gist options
  • Save citrus-it/a8008da2eaa0909383d477d74d27a865 to your computer and use it in GitHub Desktop.
Save citrus-it/a8008da2eaa0909383d477d74d27a865 to your computer and use it in GitHub Desktop.
reaper# zadm show test
{
   "cloud-init" : "on",
   # - sshkey can also be a path to a file, current attr limit of 256 characters is problematic
   "sshkey" : "ssh-ed25519 AAAAC3N...nl9Hqpi7j4acP8s",
   # password can be a hash or just the desired password
   "password" : "$6$SEeDRaFR$CI8Y/wfMXioIWlrtTLs75iOA4m/./1Vu78d5Plhk6N/T.yctR/s8ojMIjIhyIJB8lwYJAlQXi5GBuh4O0gjY5/",

   "autoboot" : "false",
   "bootargs" : "",
   "bootdisk" : {
      "blocksize" : "8K",
      "path" : "data/omniosce/hdd-test0",
      "size" : "10G",
      "sparse" : "true"
   },
   "bootorder" : "dc",
   "bootrom" : "BHYVE_CSM",
   "brand" : "bhyve",
   "diskif" : "virtio",
   "dns-domain" : "omnios.org",
   "fs-allowed" : "",
   "hostbridge" : "i440fx",
   "hostid" : "",
   "ip-type" : "exclusive",
   "limitpriv" : "default",
   "net" : [
      {
         "allowed-address" : "172.27.10.1/24",
         "defrouter" : "172.27.10.254",
         "global-nic" : "switch10",
         "mac-addr" : "2:8:20:7c:68:79",
         "physical" : "omniosr99"
      }
   ],
   "netif" : "virtio",
   "pool" : "",
   "ram" : "4G",
   "resolvers" : [
      "1.1.1.1",
      "9.9.9.9"
   ],
   "rng" : "off",
   "scheduling-class" : "",
   "type" : "generic",
   "vcpus" : "4",
   "vga" : "off",
   "vnc" : "off",
   "xhci" : "off",
   "zonename" : "test",
   "zonepath" : "/data/zone/test"
}
reaper# dd if=/data/iso/debian-10-generic-amd64-20210721-710.raw of=/dev/zvol/rdsk/data/omniosce/hdd-test0 bs=1M
2048+0 records in
2048+0 records out
2147483648 bytes transferred in 18.661335 secs (110MB/sec)
reaper# zadm boot -C test
[Connected to zone 'test' console]

[NOTICE: Zone booting up]
Loading Linux 4.19.0-17-amd64 ...
Loading initial ramdisk ...
[    0.000000] Linux version 4.19.0-17-amd64 ([email protected]) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.194-3 (2021-07-18)
[    3.446265] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[    3.456404] systemd[1]: Detected virtualization bhyve.
[    3.458079] systemd[1]: Detected architecture x86-64.

Welcome to Debian GNU/Linux 10 (buster)!

[    4.948559] virtio_net virtio1 omniosr99: renamed from enp0s6
[    5.011623] cloud-init[401]: Cloud-init v. 20.2 running 'init-local' at Thu, 12 Aug 2021 07:37:02 +0000. Up 4.64 seconds.
[  OK  ] Started Initial cloud-init job (pre-networking).
[  OK  ] Reached target Network (Pre).
         Starting Raise network interfaces...
[  OK  ] Started ifup for enp0s6.
[FAILED] Failed to start Raise network interfaces.
See 'systemctl status networking.service' for details.
[  OK  ] Reached target Network.
         Starting Initial cloud-init (metadata service crawler)...
[    5.771127] cloud-init[663]: Cloud-init v. 20.2 running 'init' at Thu, 12 Aug 2021 07:37:03 +0000. Up 5.61 seconds.
[    5.775599] cloud-init[663]: ci-info: +++++++++++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++++++++++
[    5.780315] cloud-init[663]: ci-info: +-----------+------+---------------------------+---------------+--------+-------------------+
[    5.785203] cloud-init[663]: ci-info: |   Device  |  Up  |          Address          |      Mask     | Scope  |     Hw-Address    |
[    5.790011] cloud-init[663]: ci-info: +-----------+------+---------------------------+---------------+--------+-------------------+
[    5.792948] cloud-init[663]: ci-info: |     lo    | True |         127.0.0.1         |   255.0.0.0   |  host  |         .         |
[    5.795976] cloud-init[663]: ci-info: |     lo    | True |          ::1/128          |       .       |  host  |         .         |
[    5.799113] cloud-init[663]: ci-info: | omniosr99 | True |        172.27.10.1        | 255.255.255.0 | global | 02:08:20:7c:68:79 |
[    5.802427] cloud-init[663]: ci-info: | omniosr99 | True | fe80::8:20ff:fe7c:6879/64 |       .       |  link  | 02:08:20:7c:68:79 |
[    5.805414] cloud-init[663]: ci-info: +-----------+------+---------------------------+---------------+--------+-------------------+
[    5.808483] cloud-init[663]: ci-info: ++++++++++++++++++++++++++++++Route IPv4 info++++++++++++++++++++++++++++++
[    5.811049] cloud-init[663]: ci-info: +-------+-------------+---------------+---------------+-----------+-------+
[    5.814134] cloud-init[663]: ci-info: | Route | Destination |    Gateway    |    Genmask    | Interface | Flags |
[    5.817033] cloud-init[663]: ci-info: +-------+-------------+---------------+---------------+-----------+-------+
[    5.819419] cloud-init[663]: ci-info: |   0   |   0.0.0.0   | 172.27.10.254 |    0.0.0.0    | omniosr99 |   UG  |
[    5.821840] cloud-init[663]: ci-info: |   1   | 172.27.10.0 |    0.0.0.0    | 255.255.255.0 | omniosr99 |   U   |
[    5.824242] cloud-init[663]: ci-info: +-------+-------------+---------------+---------------+-----------+-------+
[    5.826587] cloud-init[663]: ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++
[    5.829171] cloud-init[663]: ci-info: +-------+-------------+---------+-----------+-------+
[    5.832090] cloud-init[663]: ci-info: | Route | Destination | Gateway | Interface | Flags |
[    5.836334] cloud-init[663]: ci-info: +-------+-------------+---------+-----------+-------+
[    5.839804] cloud-init[663]: ci-info: |   1   |  fe80::/64  |    ::   | omniosr99 |   U   |
[    5.843351] cloud-init[663]: ci-info: |   3   |  multicast  |    ::   | omniosr99 |   U   |
[    5.846879] cloud-init[663]: ci-info: +-------+-------------+---------+-----------+-------+
[    6.430873] cloud-init[663]: Generating public/private rsa key pair.
[    6.433917] cloud-init[663]: Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
[    6.437578] cloud-init[663]: Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
[    6.441155] cloud-init[663]: The key fingerprint is:
[  OK  ] Reached target Cloud-init target.

Debian GNU/Linux 10 test ttyS0

test login: debian
Password:
Linux test 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

debian@test:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: omniosr99: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 02:08:20:7c:68:79 brd ff:ff:ff:ff:ff:ff
    inet 172.27.10.1/24 brd 172.27.10.255 scope global omniosr99
       valid_lft forever preferred_lft forever
    inet6 fe80::8:20ff:fe7c:6879/64 scope link
       valid_lft forever preferred_lft forever

debian@test:~$ ip r
default via 172.27.10.254 dev omniosr99 onlink
172.27.10.0/24 dev omniosr99 proto kernel scope link src 172.27.10.1

debian@test:~$ cat .ssh/authorized_keys
ssh-ed25519 AAAAC3N...nl9Hqpi7j4acP8s cinit

debian@test:~$ ping google.com
PING google.com (216.58.213.14) 56(84) bytes of data.
64 bytes from ber01s14-in-f14.1e100.net (216.58.213.14): icmp_seq=1 ttl=117 time=5.78 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment