How things are now:
I have a PC which runs Windows 7 in a headless fashion with no monitor and keyboard, etc. At home when it starts it automatically joins the home Wifi network. I can then remote into this said headless PC from another computer (the "controlling PC") which is also on the same home Wifi network. I have the router assign a reserved IP address to this headless PC, so I know what IP address to use with Remote Desktop. This is all good.
What I want to achieve:
However, there are occasions I would like to use this headless PC outside the range of the home Wifi network. When this happens, both the headless PC and the controlling PC would not be able to connect to a Wifi network, and Remote Desktop obviously will not work.
What I have tried:
Now I have read about using netsh to create "virtual" access point. I have tried the following successfully:
On the headless PC, while it is still connected to the home Wifi network:
Run Cmd as administrator
Run netsh wlan set hostednetwork mode=allow "ssid=SSID" "key=KEY" keyUsage=persistent
Run netsh wlan start hostednetwork
On the controlling PC:
Connect to "SSID" network created by netsh
Find out what IP address itself got assigned (e.g. 192.168.173.xx)
Remote desktop into the headless PC using 192.168.173.1, changing 'xx' to '1'
My questions:
The steps in the above experiment are of little use to me, as they require me setting up the virtual AP with the headless PC connected to the home Wifi network.
Even if I am to put a startup script to run netsh automatically, if the headless PC is not connected to the home Wifi DHCP, how is it going to get an IP address?
And even if it manages to get an IP address, how do I find out what it is so I can put that into Remote Desktop?
Is there some way I can automate the above process? i.e. If the headless PC fails to connect to the home network, I am hoping it will automatically turn itself into a virtual AP and giving itself a pre-determined IP such that I can remote into it?
I hope I have made my questions clear....Any help would be very much appreciated.
