Starting VM with RDP

proxfox

New Member
Mar 31, 2020
11
0
1
25
Hello,

the general method of starting a vm/container with the proxmox web UI is to complicate in my opinion. I want to start, espacially my windows vm´s with an RDP request. So whenever i try to access a vm it should start by itself. I wonder if some script already exists. I searched the internet and found some solutions but not with RDP. My programming skills are very primitive, otherwise i would've tried it by myself. Maybe there also is some other kind of method i never heard of that works as good as my method. I hope you guys can help me.
 
Hello,

I think what you're looking for is a VDI broker solution which basically would be a totally from PVE independent product. Such a solution allows to dynamically launch VMs on-demand with a predefined VM-Template. But most VDI-brokers I know are not really for free or not even open source.

Anyway - PVE's focus is not on this kind of brokering, but could be achieved by solutions using the PVE API.

regards
 
Hello,

the general method of starting a vm/container with the proxmox web UI is to complicate in my opinion. I want to start, espacially my windows vm´s with an RDP request. So whenever i try to access a vm it should start by itself. I wonder if some script already exists. I searched the internet and found some solutions but not with RDP. My programming skills are very primitive, otherwise i would've tried it by myself. Maybe there also is some other kind of method i never heard of that works as good as my method. I hope you guys can help me.

Starting a computer via RDP isn't possible.
Neither physical nor virtualized.
Usually you could let your VM run 24/7 or you use Wake on LAN.
The WOL feature needs some extra configuration and a second Tool to start the VM.
Maybe the 24/7 running VM is the easiest solution.
 
I depends how you have this set up. If it's in private network then I would make a simple tcp listener that will use proxmox api to check if machine is alive already. if not then it would trigger the guest startup using pve api. If machine is already in running state then it would just pass tcp traffic (proxy). This probably makes you connect twice to rdp port - first one to trigger, but will time out, second time to really make a connection. This also needs some other machine to be utilized to be the middle man.
 
Either by using WOL or an API driven solution, the biggest dissadvantage will be the time used by Windows to fully boot up.
Even on fast storage it will last much longer until an RDP connect could be possible.
Big VDI Solutions may hold templates in RAM to speed up booting those templates, but this may be very unusual in soho or private environments.

Best solution in point of usage would be a 24/7 running VM.
Extra power consumption of a VM with idle Desktop only isn't much more expansive compared with a stopped VM.
 
Has there been any advancements here lately? I’ve been searching for this particular feature as well, due to having a few old Windows XP VMs that seem to take a fair amount of resources even when idling, and they are needed weekly at best so keeping them up 24/7 is just dumb.

I was wondering if a solution similar to knockd could be used to listen on a forwarded port on the PVE host, and if a connection is coming it would run a script to check VM status and start/resume it if needed, also setting a timer to shutdown/suspend it after a few hours if no connection is active?

Or if I use PVE firewall, would that be able see incoming connection attempts and active connections so a script could simply monitor the firewall logs?

In addition to RDP, I think the exact same procedure should work with VNC as well. Even the integrated NoVNC thingy too..so this could pretty easily be standard feature like RDP is in VirtualBox.
 
Maybe a batch can do that too? First start the VM using the PVE API, wait some seconds until the qemu guest agent is responding and then initialize the RDP connection?
 
You suggest a batch script run by the user on their local device before they attempt to connect to the VM?

That certainly could work but not as automatic as I’d like: The device they’re connecting from could be Windows, macOS, Android or iOS, all of which would require their own scripts, right?

So fully server side solution would be ideal, again, similar to the RDP feature in VirtualBox. It does not matter that the initial RDP connection fails because the VM is down, the users would just be instructed to try again in 15 secs or so (and I think resume from suspended state takes only a few seconds).

Will look into what the API has to offer anyway, never have really investigated that. (Btw, have not succeeded with qemu guest agent on Win XP yet)
 

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!