TritonDataCenter / smartos-live

For more information, please see http://smartos.org/ For any questions that aren't answered there, please join the SmartOS discussion list: https://smartos.topicbox.com/groups/smartos-discuss
1.57k stars 245 forks source link

OS-8108 Support vnc password for BHYVE #900

Closed jasonbking closed 4 years ago

sjorge commented 4 years ago

Is there a counter part somewhere for zhyve/bhyve? I thought upstream didn't support setting passwords. Found it: joyent/illumos-joyent#256

jasonbking commented 4 years ago

https://github.com/joyent/illumos-joyent/pull/256 -- it did but it was never wired up in the port (turned out to be easier than originally thought).

sjorge commented 4 years ago

LGTM, doing a build now to test.

sjorge commented 4 years ago

I did spend 10 minutes wondering why it was no longer listening, but then I remembred the old bug where I need to restart vmadmd after making a change to vnc_port.

[root@boron ~]# netstat -na | grep LISTEN
127.0.0.1.4999            *.*                 0      0 1048576      0 LISTEN
      *.111                *.*                 0      0 1048576      0 LISTEN
      *.111                *.*                 0      0 1048576      0 LISTEN
      *.22                 *.*                 0      0 1048576      0 LISTEN
127.0.0.1.9090             *.*                 0      0 1048576      0 LISTEN
127.0.0.1.8080             *.*                 0      0 1048576      0 LISTEN
127.0.0.1.25               *.*                 0      0 1048576      0 LISTEN
127.0.0.1.587              *.*                 0      0 1048576      0 LISTEN
      *.111                             *.*                              0      0 1048576      0 LISTEN
      *.22                              *.*                              0      0 1048576      0 LISTEN
::1.25                                  *.*                              0      0 1048576      0 LISTEN
[root@boron ~]# svcadm restart vmadmd
[root@boron ~]#netstat -na | grep LISTEN
127.0.0.1.4999            *.*                 0      0 1048576      0 LISTEN
      *.111                *.*                 0      0 1048576      0 LISTEN
      *.111                *.*                 0      0 1048576      0 LISTEN
      *.22                 *.*                 0      0 1048576      0 LISTEN
127.0.0.1.9090             *.*                 0      0 1048576      0 LISTEN
127.0.0.1.25               *.*                 0      0 1048576      0 LISTEN
127.0.0.1.587              *.*                 0      0 1048576      0 LISTEN
127.0.0.1.8080             *.*                 0      0 1048576      0 LISTEN
10.23.40.211.5901          *.*                 0      0 1048576      0 LISTEN
      *.111                             *.*                              0      0 1048576      0 LISTEN
      *.22                              *.*                              0      0 1048576      0 LISTEN
::1.25                                  *.*                              0      0 1048576      0 LISTEN

It's working fine, I get prompted for a password!

The man page does need updating though:

       vnc_password:

           This property allows you to set a password which will be required when
           connecting to the VNC port. IMPORTANT: this password will be visible
           from the GZ of the CN and anyone with access to the serial port in the
           guest. Set to an empty string (default) to not require a password at
           this level.

           type: string (8 chars max)
           vmtype: kvm
           listable: no
           create: yes
           update: yes
           default: <unset>
sjorge commented 4 years ago
       vnc_password:

           This property allows you to set a password which will be required when
           connecting to the VNC port. IMPORTANT: this password will be visible
           from the GZ of the CN. For KVM anyone with access to the serial port in the
           guest can also see the password. Set to an empty string (default) to not
           require a password at this level.

           Changing the password will require a reboot of the zone before the change
           becomes active. (Reboots from inside the guest is not enough)

           type: string (8 chars max)
           vmtype: HVM
           listable: no
           create: yes
           update: yes
           default: <unset>

I think the above should be fine for the new man page entry for vnc_password.