Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
docs.it4i.cz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Radim Sojka
docs.it4i.cz
Commits
80c974e6
Commit
80c974e6
authored
7 years ago
by
David Hrbáč
Browse files
Options
Downloads
Patches
Plain Diff
Fixes sccs/docs.it4i.cz#57
parent
e1e4ff1a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs.it4i/anselm/software/virtualization.md
+37
-36
37 additions, 36 deletions
docs.it4i/anselm/software/virtualization.md
with
37 additions
and
36 deletions
docs.it4i/anselm/software/virtualization.md
+
37
−
36
View file @
80c974e6
...
...
@@ -106,42 +106,43 @@ For Windows operating systems we suggest using Local Group Policy Startup script
Example startup script for Windows virtual machine:
```
bash
@echo off
set
LOG
=
c:startup.log
set
MAPDRIVE
=
z:
set
SCRIPT
=
%MAPDRIVE%run.bat
set
TIMEOUT
=
300
echo
%DATE% %TIME% Running startup script>%LOG%
rem Mount share
echo
%DATE% %TIME% Mounting shared drive>%LOG%
net use z: 10.0.2.4qemu
>
%LOG% 2>&1
dir
z:
>
%LOG% 2>&1
echo.
>
%LOG%
if
exist %MAPDRIVE%
(
echo
%DATE% %TIME% The drive
"%MAPDRIVE%"
exists>%LOG%
if
exist %SCRIPT%
(
echo
%DATE% %TIME% The script file
"%SCRIPT%"
exists>%LOG%
echo
%DATE% %TIME% Running script %SCRIPT%>%LOG%
set
TIMEOUT
=
0
call %SCRIPT%
)
else
(
echo
%DATE% %TIME% The script file
"%SCRIPT%"
does not exist>%LOG%
)
)
else
(
echo
%DATE% %TIME% The drive
"%MAPDRIVE%"
does not exist>%LOG%
)
echo.
>
%LOG%
timeout
/T %TIMEOUT%
echo
%DATE% %TIME% Shut down>%LOG%
shutdown /s /t 0
```
bat
@echo
off
set
LOG
=
c
:\startup.log
set
MAPDRIVE
=
z
:
set
SCRIPT
=
%MAPDRIVE%
\run.bat
set
TIMEOUT
=
300
echo
%DATE%
%TIME%
Running
startup
script
>
%LOG%
rem Mount share
echo
%DATE%
%TIME%
Mounting
shared
drive
>>
%LOG%
net
use
z
: \\10.0.2.4\qemu
>>
%LOG%
2
>&
1
dir
z
:\
>>
%LOG%
2
>&
1
echo
.
>>
%LOG%
if
exist
%MAPDRIVE%
\
(
echo
%DATE%
%TIME%
The
drive
"
%MAPDRIVE%
"
exists
>>
%LOG%
if
exist
%SCRIPT%
(
echo
%DATE%
%TIME%
The
script
file
"
%SCRIPT%
"
exists
>>
%LOG%
echo
%DATE%
%TIME%
Running
script
%SCRIPT%
>>
%LOG%
set
TIMEOUT
=
0
call
%SCRIPT%
)
else
(
echo
%DATE%
%TIME%
The
script
file
"
%SCRIPT%
"
does
not
exist
>>
%LOG%
)
)
else
(
echo
%DATE%
%TIME%
The
drive
"
%MAPDRIVE%
"
does
not
exist
>>
%LOG%
)
echo
.
>>
%LOG%
timeout
/T
%TIMEOUT%
echo
%DATE%
%TIME%
Shut
down
>>
%LOG%
shutdown
/s /t
0
```
Example startup script maps shared job script as drive z: and looks for run script called run.bat. If run script is found it is run else wait for 5 minutes, then shutdown virtual machine.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment