#
# vnc_listen = "0.0.0.0"
+# Enable this option to have VNC served over an automatically created
+# unix socket. This prevents unprivileged access from users on the
+# host machine, though most VNC clients do not support it.
+#
+# This will only be enabled for VNC configurations that do not have
+# a hardcoded 'listen' or 'socket' value.
+#
+# vnc_auto_unix_socket = 1
# Enable use of TLS encryption on the VNC server. This requires
# a VNC client which supports the VeNCrypt protocol extension.
def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
virBuffer opt = VIR_BUFFER_INITIALIZER;
- if (def->graphics[0]->data.vnc.socket) {
+ if (def->graphics[0]->data.vnc.socket ||
+ driver->vncAutoUnixSocket) {
+
+ if (!def->graphics[0]->data.vnc.socket &&
+ virAsprintf(&def->graphics[0]->data.vnc.socket,
+ "%s/%s.vnc", driver->libDir, def->name) == -1) {
+ goto no_memory;
+ }
+
virBufferVSprintf(&opt, "unix:%s",
def->graphics[0]->data.vnc.socket);
return -1; \
}
+ p = virConfGetValue (conf, "vnc_auto_unix_socket");
+ CHECK_TYPE ("vnc_auto_unix_socket", VIR_CONF_LONG);
+ if (p) driver->vncAutoUnixSocket = p->l;
+
p = virConfGetValue (conf, "vnc_tls");
CHECK_TYPE ("vnc_tls", VIR_CONF_LONG);
if (p) driver->vncTLS = p->l;
char *cacheDir;
char *saveDir;
char *snapshotDir;
+ unsigned int vncAutoUnixSocket : 1;
unsigned int vncTLS : 1;
unsigned int vncTLSx509verify : 1;
unsigned int vncSASL : 1;