- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Startup on linux server boot
Hello everyone, how do I boot virtual machines when booting the server running the Debian 12 OS with VMware Workstation 17 Pro? (VMs are Debian 12 too).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could probably create a small shell script, using vmrun to start the VM's you want.
Then, create a cron job:
sudo crontab -e
And add
@reboot <name of your shell script with path> &
I use this to run a AV scan on Debian 12, I would think it should work for vmrun.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I appreciate your guidance, but what would a shell script with path look like? Could you give me an example?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, so I have a vm named debianb in /vmware2.
I test starting that VM via the command line with:
vmrun start /vmware2/debianB/DebianB.vmx
it starts OK. That is what I need in my script.
So, I create a script in my home directory:
(I use nano, use any text editor):
nano startvms.sh
line1 =#!/bin/bash
line2 = vmrun start /vmware2/debianB/DebianB.vmx
more lines if you want to run more VM's
Control-o to save the script
Control x to exit Nano.
make it executable:
chmod +x startvms.sh
sudo crontab -e
@Reboot~/startvms.sh &
I didn't test that but it is the same that I use to run clamscan
run vmrun --help to see a laundry list of options and commands with examples.
Some days the dragon wins.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had problems with crontab, it didn't work, I run Debian 12, so I activated rc.local and entered the commands to raise my vms, as per your instructions, and everything worked perfectly.
I appreciate your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
glad to hear it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My current problem is that I am forced to use the "nogui" command to raise the vms, I would really like this not to be necessary, because with the "nogui" command I cannot view the vms, they are all 100% in the background.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess I don't understand what you want to do. If you want to start the VM's prior to login, you won't have GUI, there is no X engine running. I have seen hacks but have no idea if any would work. This is true for any program. If you need the GUI, run the script from startup programs for each user. Or just put a launcher on the panel and give it a click.
This is really a Linux question.
Lou
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is the problem, at boot time there is no X environment raised, and as it is a server there will never be anyone directly using this machine, so the VMs are launched without a gui even using the "nogui" parameter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, you could remote into them. Because of all that, our servers are running on ESXi, you can use Player as a Console. For our surveillance systems, I use tightvnc over a VPN connection.
Lou