In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
This paper comes from an engineering practice, and records the experience gained here, hoping to be helpful to the latecomers.
The company purchased a PC, genuine Win10 home version, used to do the finance department's UF server. At the same time, UF client is also installed for financial personnel to log in to remote desktop, so that there is no need to install clients on physical hosts one by one. If you need several clients, you can clone several virtual machines and open remote desktop permissions.
Because the software version is older, after-sales said it is best XP system, in view of the new PC even install WIN7 is very cumbersome (need to inject XHCI driver, otherwise can not use USB device), let alone XP, so can only use virtual machine mode installation.
In the choice of virtual machines, Hyper-V and VMware workstion have tried, but found that the former display ratio can only be square screen, can not fill the current widescreen display, financial software because of the limitation of the display area can not be used, in addition to the need to upgrade Win10 Home Edition to Professional Edition, which can not be activated, lost the advantage of genuine; VMware workstation worked well, expanding to full screen size to make the most of the display area, so VMware workstation Pro 15 was retained.
In order to save electricity and prolong the service life of the machine, the automatic switch function is set. Since the finance department only works on weekdays, set the BIOS to automatically turn on the host from Monday to Friday at 7:00 a.m., and set the host to automatically turn off at 6:00 p.m. in WIN10's scheduled tasks. Run a batch process to power on all VMs after powering on the host, and power off all VMs before powering off the host.
After all these configurations are completed and running normally for a few days, I suddenly found that the virtual machine could not be shut down because the financial staff did not exit the client on the remote desktop. At this time, if you use the vmrun command line to shut down the virtual machine, the financial client will pop up a window asking "Yes/No", and then XP will pop up a dialog box to forcibly close the program, so the virtual machine shutdown process is stuck here:
To solve this problem, write a vbs script that simulates sending the letter E on the keyboard, which forces the current program to close, XP shutdown is complete, but although I wrote the script, I found that I could not run the vbs script in the virtual machine with vmrun (if you know, please explain in the comments section, I will list you as the author here). But running bat is still possible, so after Baidu, bat and vbs are combined into one:
Batch processing off.bat, stored in the virtual machine D packing directory, before XP is closed, the physical host calls from the outside to run, delay 10 seconds to send key E.
Sub batstart wscript -e:vbs "%~f0"Exit SubEnd Subrem -----------The following is vbs script-----------Set objShell=CreateObject("Wscript.Shell")WScript.Sleep 10000objShell.SendKeys"{E}"
Boot batch start.bat, physical host running, called by scheduled task, trigger set to "at startup" Run:
:: Open the UF server "C:\Program Files (x86)\VMware\VMware Workstation\vmrun" start "D:\VM\server\Server.vmx" nogui:: Open the UF client "C:\Program Files (x86)\VMware\VMware Workstation\vmrun" start "D:\VM\clint01\Windows XP Professional.vmx" nogui
Shutdown batch stop.bat, physical host running, invoked by task schedule, trigger set to "on schedule," runs daily at 18:00 PM:
:: Virtual machine-Yonyou client shutdown, virtual xp first run off.bat, delay 10s send key E, then close xp, will pop up close program inquiry window, at this time just receive E"C:\Program Files (x86)\VMware\VMware Workstation\vmrun" -T ws -gu aaa -gp 0 runPrograminGuest "D:\VM\clint01\Windows XP Professional.vmx" "c:\windows\system32\off.bat""C:\Program Files (x86)\VMware\VMware Workstation\vmrun" stop "D:\VM\clint01\Windows XP Professional.vmx":: Virtual Machine-UF Server Shutdown "C:\Program Files (x86)\VMware\VMware Workstation\vmrun" stop "D:\VM\server\Server.vmx" nogui:: shutdown physical host/s
OK, goal achieved!
Other experiences:
1. The NIC of the physical host can be set without address, or set to a non-existent network segment address, and the virtual machine is set to a legal network segment address, so that the physical host is separated from the virtual machine network and more secure.
2. If you only shut down the physical host, you don't have to bother with the above. The shutdown command is: shutdown /s /f, regardless of whether the virtual machine pops up the inquiry window, it will be forcibly shut down.
3, with Win10 Notepad editing batch processing, found that ANSI encoding is better than the default UTF-8 encoding compatibility.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.