Solved

autostart a VM in Windows 10

Posted on 2016-09-05
17
74 Views
Last Modified: 2016-09-15
I would like to create a Windows 7 VM that runs in Windows 10 HyperV and starts up automatically so that when I startup Windows 10/turn on the system I eventually get a prompt to log me into the Win 7 VM.  Any tips are appreciated.
0
Comment
Question by:lineonecorp
  • 7
  • 5
  • 5
17 Comments
 
LVL 53

Expert Comment

by:McKnife
Comment Utility
Hyper-v will by default suspend all running guest machines when the host ist shutdown and will resume them when your host restarts, so no need for action.
0
 

Author Comment

by:lineonecorp
Comment Utility
Thanks for the quick reply.  So if I am in a Windows 7 VM that is domain joined and I log out of the Win 7 session so I am left at the login screen of the VM to log back into the domain when I reboot the host I will be taken back to the login screen?
0
 
LVL 53

Expert Comment

by:McKnife
Comment Utility
Right.
0
 
LVL 2

Expert Comment

by:kapsionu
Comment Utility
What about host system login? Auto login? PS! Hyper-V guest won’t open automatically; it needs to be activated first from host system's HV manager. There is no good way to show instantaneously Guest Win7 login screen with Hyper-V.
0
 
LVL 53

Expert Comment

by:McKnife
Comment Utility
We need to be precise. All that we want can be achieved. Not only will the vm resume on its own, but also to see it right away full screen would be possible using a script that uses mstsc.exe or vmconnect.exe to connect to it.
0
 
LVL 2

Expert Comment

by:kapsionu
Comment Utility
If this is a end-user environment, host OS auto login must be secured accordingly (with guest permission template or something similar) or there is a security issue. In any case, there is maybe better VM solutions as Hyper-V for this scenario and "better end-user experience than RDP".
0
 

Author Comment

by:lineonecorp
Comment Utility
Sorry. I don't understand either answer.  Can you please elaborate with the necessary steps in my scenario -Win 7 VM running on Windows 10 HyperV. Not interested in any other scenario.  Thanks in advance.
0
 

Author Comment

by:lineonecorp
Comment Utility
Perhaps Powershell?
0
Want to promote your upcoming event?

Attending an event? Speaking at a conference? Or exhibiting at a tradeshow? Easily inform your contacts by using a promotional banner in your email signature. This will ensure your organization’s most important contacts are in the know.

 
LVL 53

Expert Comment

by:McKnife
Comment Utility
vmconnect.exe and mstsc.exe are command line programs, built-into windows. They can be used to achieve what you want. open a command shell and type
vmconnect /?
mstsc /?
for usage hints.
0
 

Author Comment

by:lineonecorp
Comment Utility
Thanks. Are you saying I can make a script with mstsc so that when the VM starts up it will take people to a RDP prompt?
0
 
LVL 2

Expert Comment

by:kapsionu
Comment Utility
As I can see no good answers provided. Let’s try to help or add few thoughts :).
Assume, that You have some kind of domain involved.
Make one account to domain for win10 PC to log in exclusively on those PC’s that need this Remote desktop connection. Password never expires needed also for this account (if it is not restricted from GPO). Also if You want to protect this environment, make a list of domain computers within this account can log on to.
Now add to this domain account “properties” – “environment” – “start the following program at logon” value something like this “mstsc /v:your rdp server ip address /f /prompt” full path maybe needed for mstsc.exe try this out for Yourself.
Now You can verify, is the connection popup for login will open when You log to win10 pc with this dedicated login account in domain. If it does and RDP connection is made You are in the final step:
You need to log on automatically to those PC’s with win10 and with dedicated account.
Log to win10 with administrative privileges and follow steps from this page example (in domain environment it’s little bit tricky): http://www.tenforums.com/tutorials/3539-sign-user-account-automatically-windows-10-startup.html.
Finally You got Win10 domain PC, that has auto logon to domain and domain pushes this account to open only RDP connection to certain RDP server. You are done and users can log in to whatever domain rdp server.
If you do not join your win10 PC to domain, it’s more simple to configure just guest account (or what you ever like) without special permissions and add rdp connection string to startup - Your choice. Best of luck!
Let's hope Your win10 hyper-v environment is faster than autologon not to see "cannot connect" on autologon :).
0
 
LVL 53

Expert Comment

by:McKnife
Comment Utility
"As I can see no good answers provided" - sorry, what is wrong? As soon as I find the time after lunch, I will comment on this.
0
 
LVL 2

Expert Comment

by:kapsionu
Comment Utility
Pretty long lunch - from 6th of september 2016. I love those experts :). This is the reason I keep my mouth shut from the registration time and better keep myself as reader. Pointless arguing.
0
 
LVL 53

Accepted Solution

by:
McKnife earned 500 total points
Comment Utility
"Are you saying I can make a script with mstsc so that when the VM starts up it will take people to a RDP prompt?" - I asked you to please look at mstsc /? to familiarize with the command line tool for remote desktop. mstsc can open connection files (.rdp files with saved logon settings), so that a script can be used to autoconnect to a vm. By the way, concerning "In any case, there is maybe better VM solutions as Hyper-V for this scenario and "better end-user experience than RDP" - I don't see what you are missing. RDP is the default for connecting to hyper-v VMs. He uses hyper-V, there is no other way.

lineonecorp, what you could do with such a script: you could have it start right after logon to win10. So you could place it in autostart (%appdata%\Microsoft\Windows\Start Menu\Programs\Startup) as a batch file. Content would be a one liner like this:
mstsc c:\test\test.rdp

Open in new window

You get the idea?
Now about kapsionu's smart "Let's hope Your win10 hyper-v environment is faster than autologon not to see "cannot connect" on autologon :)." which is true, I advice you to test it. If too slow, just add another line to your batch beginning:
timeout 10
(for 10 seconds).
1
 
LVL 53

Expert Comment

by:McKnife
Comment Utility
"Pretty long lunch - from 6th of september 2016. I love those experts :)." - september 6th? I wrote that today, what are you loving?
0
 
LVL 2

Expert Comment

by:kapsionu
Comment Utility
"By the way, concerning "In any case, there is maybe better VM solutions as Hyper-V for this scenario and "better end-user experience than RDP" - I don't see what you are missing. RDP is the default for connecting to hyper-v VMs. He uses hyper-V, there is no other way."

In this kind of environment where there is ~30PC's involved, I looked a little bit out of the box, banned PC's local storage for guest hdd images and local hyper-v forever. Guests running with virtualbox full boost memory+cpu and 2D+3D gpu acceleration and vm guests hdd's are mapped from storage server 2+GB of raid controller cache and r10 with snapshot and backup to slower storage. 1Gbit of LAN for PC's and trunck 4Gbits for storage server it is just perfect how it performs. If some kind of local PC dies, it needs just whatever host system and remap of guest hdd and off we go. Under development environment is also tested w2016tp5 with hyper-v mode dedupe - works very nice and storage deduplication ratio is amazing, cant wait for retail of w2016. That's my few points about this "end-user experience" issue. RDP unfortunately not comparable with this kind of solution and hyper-v and UNC path mapped guest hdd is bunch of headache. I use RDP only for server management or remote connection through limited bandwidth :).
1
 

Author Comment

by:lineonecorp
Comment Utility
McKnife:

Thanks. I think I got the idea.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

#Citrix #XenApp #Citrix Scout #Citrix Insight Services #Microsoft VMMAP #Microsoft ADEXPLORE #Microsoft RAMMAP #Microsoft TCPVIEW #Microsoft AUTORUNS #Microsoft PROCESS EXPLORER #Microsoft PROCESS MONITOR
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now