Skip to content

Instantly share code, notes, and snippets.

@mgerdts
Created July 18, 2019 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgerdts/dcfb0710b73745b4767b8e52f2e47f6d to your computer and use it in GitHub Desktop.
Save mgerdts/dcfb0710b73745b4767b8e52f2e47f6d to your computer and use it in GitHub Desktop.
create ubuntu 18.04 20190627 bhyve instance
[root@raidz /zones]# ssh-keygen -t rsa -P "" -f id_rsa
Generating public/private rsa key pair.
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
MD5:58:e7:5e:2e:a5:05:95:58:da:97:06:f8:5f:60:b8:c4 root@raidz
The key's randomart image is:
+---[RSA 2048]----+
|           =+o   |
|          o+E.o. |
|        . +o.o+. |
|       o o .oo  .|
|      . S . +. . |
|         . *  .  |
|          + .    |
|           .     |
|                 |
+------[MD5]------+
[root@raidz /zones]# cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCpPojweGMFGBnzi8yHHxCSJNL85QkfZOy/oaum/mFjdZdPamovfK3Lj22hsXp/Gu7nIuMpOmRiMPnzbvBu8yyxme4av/ZVoyfzBR/ltcPzTaOLCIOMzXjPHwVYN25vNbQ5DHe/+HKkZIEKb5Uz3ddcyRwmDNO4GvICTWWKxopi7LSsqGVKQiFJnd/Z/r4fmXFef+S/BQ2vf+xxxlWRcaLqlS28ujycJy5s8Drq/QwclXdHFJ/FJIcrm2xDBCx4L3srgH5RPLSHcj6+L6K2Gb2enRMtHLBjxSy7/9UJjcEf5jWikadEYBEiNz7gzV2+nyID/a34uPd6grul825NWKlV root@raidz
[root@raidz /zones]# vi b2.json
[root@raidz /zones]# vmadm create -f b2.json
Successfully created VM 1e96a46c-d3c0-6b19-b811-9a2b5a850369
[root@raidz /zones]# zlogin -C 1e96a46c-d3c0-6b19-b811-9a2b5a850369
[Connected to zone '1e96a46c-d3c0-6b19-b811-9a2b5a850369' console]
[    0.000000] Linux version 4.15.0-54-generic (buildd@lgw01-amd64-014) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 (Ubuntu 4.15.0-54.58-generic 4.15.18)
...
[    5.956103] EXT4-fs (vda1): re-mounted. Opts: (null)
[    6.072233] iscsi: registered transport (iser)

Ubuntu 18.04.2 LTS 1e96a46c-d3c0-6b19-b811-9a2b5a850369 ttyS0

1e96a46c-d3c0-6b19-b811-9a2b5a850369 login: ~.
[root@raidz /zones]# ssh -l ubuntu -i id_rsa 10.88.88.102
The authenticity of host '10.88.88.102 (10.88.88.102)' can't be established.
ECDSA key fingerprint is SHA256:nzD4OSBla1PzzB50QKJCnLz3HBG6NkVUDCR7ZBDByEo.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.88.88.102' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-54-generic x86_64)
Certified Ubuntu Cloud Image

   __        .                   .
 _|  |_      | .-. .  . .-. :--. |-
|_    _|     ;|   ||  |(.-' |  | |
  |__|   `--'  `-' `;-| `-' '  ' `-'
                   /  ;  Instance (Ubuntu 18.04.2 LTS 20190627.1)
                   `-'   https://docs.joyent.com/images/linux/ubuntu-certified
                         http://www.ubuntu.com/cloud#joyent

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Thu Jul 18 20:47:39 UTC 2019

  System load:  0.43              Processes:           79
  Usage of /:   15.5% of 7.23GB   Users logged in:     0
  Memory usage: 25%               IP address for net0: 10.88.88.102
  Swap usage:   0%

0 packages can be updated.
0 updates are security updates.



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

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ubuntu@1e96a46c-d3c0-6b19-b811-9a2b5a850369:~$ logout
Connection to 10.88.88.102 closed.
{
"autoboot":true,
"brand":"bhyve",
"alias":"bhyve2",
"ram":512,
"vcpus":1,
"disks":[
{
"image_uuid":"9aa48095-da9d-41ca-a094-31d1fb476b98",
"boot":true,
"model":"virtio"
},
{
"size":1024,
"model":"virtio"
}
],
"nics":[
{
"nic_tag":"admin",
"ip":"10.88.88.102",
"netmask":"255.255.255.0",
"model":"virtio",
"primary":true
}
],
"customer_metadata": {
"root_authorized_keys": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCpPojweGMFGBnzi8yHHxCSJNL85QkfZOy/oaum/mFjdZdPamovfK3Lj22hsXp/Gu7nIuMpOmRiMPnzbvBu8yyxme4av/ZVoyfzBR/ltcPzTaOLCIOMzXjPHwVYN25vNbQ5DHe/+HKkZIEKb5Uz3ddcyRwmDNO4GvICTWWKxopi7LSsqGVKQiFJnd/Z/r4fmXFef+S/BQ2vf+xxxlWRcaLqlS28ujycJy5s8Drq/QwclXdHFJ/FJIcrm2xDBCx4L3srgH5RPLSHcj6+L6K2Gb2enRMtHLBjxSy7/9UJjcEf5jWikadEYBEiNz7gzV2+nyID/a34uPd6grul825NWKlV root@raidz:"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment