Avatar of Line One
Line One
 asked on

autostart a VM in Windows 10

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.
VirtualizationWindows 7Windows OS

Avatar of undefined
Last Comment
Line One

8/22/2022 - Mon
McKnife

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.
Line One

ASKER
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?
McKnife

Right.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Tarmo Kabonen

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.
McKnife

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.
Tarmo Kabonen

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".
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Line One

ASKER
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.
Line One

ASKER
Perhaps Powershell?
McKnife

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.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Line One

ASKER
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?
Tarmo Kabonen

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 :).
McKnife

"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.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Tarmo Kabonen

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.
ASKER CERTIFIED SOLUTION
McKnife

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
McKnife

"Pretty long lunch - from 6th of september 2016. I love those experts :)." - september 6th? I wrote that today, what are you loving?
Tarmo Kabonen

"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 :).
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Line One

ASKER
McKnife:

Thanks. I think I got the idea.