SaltStack Windows clients remote control shadowing using VNC
Emad R last edited by
Another SS guide how to show you how to use SaltStack + UltraVNC to remotely connect to user machines and solve their issues if the need arises to remotely login.
So 1st step is to download Ultra VNC (for compatibility use x32 build) and make it portable and configure it to your liking (ports/password/..etc), as long as it saves to an ini file, which the latest version does by default 22.214.171.124 after you launch it for the first time you will see the .ini file.
Now that you have folder (let us call it "RS") of ultravnc that contains winvnc.exe + configuration file, we will need to send it to the client that requires remote shadowing, thus upload that folder to your salt master /srv/salt directory then run:
salt '188' cp.get_dir salt://RS/ C:/
This above will move the folder to the client.
Then you will need to install ultravnc as service to bypass UAC prompts:
salt '188' cmd.run '"C:\RS\winvnc" -install'
salt '188' cmd.run '"C:\RS\winvnc" -startservice'
Now get the IP of the client and login remotely, (it is recommend that you setup password + change default port + also you can use an SSL plugin for extra security all in the configuration step prior).
You can get the IP of the minion via:
salt '188' network.ip_addrs
Then on your Windows or Linux Machine, use VNC viewer to remote connect to that client.
When you finish, you can clean up via numerous ways:
salt '188' cmd.run '"C:\RS\winvnc" -stopservice'
salt '188' cmd.run '"C:\RS\winvnc" -uninstall'
This works in LAN enviroment ofcourse, but if you want to make it work in WAN you can as well, via UltraVNC repeater, also there is another solution that rivals team viewer but it is not Open Source but free is Anydesk and quick look at its command line interface shows that you can do the same using it: