Setting VNC password permanently

CmasterG

New Member
Aug 27, 2018
19
0
1
35
Hi!

I have added in /etc/pve/local/qemu-server/100.conf the following line:

args: -vnc 0.0.0.0:100,password

but I don't know how to set a permanent password. I can set a password via the monitor of the VM, but when I restart proxmox I have to set the password again.
Can someone help me?

Thanks a lot in advance!

Cheers
 
Hi!

I have added in /etc/pve/local/qemu-server/100.conf the following line:

args: -vnc 0.0.0.0:100,password

but I don't know how to set a permanent password. I can set a password via the monitor of the VM, but when I restart proxmox I have to set the password again.


Directly not possible, but you can do it via script whenever your VM starts, e.g. with expect:

Code:
#!/usr/bin/expect

set vmid [lindex $argv 0]
set pwd [lindex $argv 2]
set dispnum [lindex $argv 1]


spawn qm monitor $vmid
expect {"qm>"}
send "change vnc 0.0.0.0:$dispnum,password\r"
expect {"qm>"}
send "set_password vnc $pwd\r"
expect {"qm>"}
send "exit\r"

and run it e.g. as follows (for VM 101 at port 5901):
Code:
myvncspript 101 1 mypassword
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!