Автозапуск виртуальной машины vmware linux

Автозапуск виртуальной машины vmware linux

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

  • VMware Technology Network
  • :
  • Desktop Hypervisor
  • :
  • VMware Workstation
  • :
  • VMware Workstation Pro Discussions
  • :
  • how to auto start a virtual machine on Linux or Wi.
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page

krisofe

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

When my host starts, I’d like to start a specifical vmc machine with a command such as :

in windows : start E:\machine.vmc in «tasks managers»

Peter_vm

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

If you want to autostart guest with your host start, use VMware Server rather than Workstation.

KYordy

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

Or use the VMplayer.exe that comes with Workstation and create a shortcut for that. You could then even drop that shortcut into your host’s startup group and start the VM when the host starts.

krisofe

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

Sorry I think I hadn’t asked well my question :

I would like automatically starting a virtual machine WITHOUT having to validate it once wmX launched.

Indeed, to boot a virtual machine, I had to do 2 steps :

First, click on the .vmc machine since Host.

Second, Validate the «Power On» of the virtual machine.

Pb is that I want the machine runs with only a command to start it like (under windows xp) :

start machine.vnc -directrun

In other words, can I start a vmplayer with parameters, (here «Power On» on

the machine I selected in Windows) ?

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

Use the vmrun command with Workstation.

KevinG

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

On a Windows or Linux host you can use the vmware command with command line options

cd «\Program Files\VMware\VMware Workstation»

vmware -x «C:\My virtual machine\winxppro.vmx»

You can also create a desktop Icon (shortcut) on the Windows desktop to launch VMware Workstation and automatically start a VM

Читайте также:  Huawei e3372 для linux

vmware -x /var/lib/vmware/virtual \machines/winxppro.vmx»

You can also use the vmrun command on both linux and windows

krisofe

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

Thks for all those infos but my pb still persists :

I tried the KevinG steps with Workstation at work and Server at home and

When I enter the line under on XP host to start any client (Fedora or XP for the

exemple) I get the white manager console of VMware but without the client

cd «\Program Files\VMware\VMware Workstation»

vmware -x «C:\My virtual machine\winxppro.vmx»

To enable vmware command I indeed added vmware in the PATH and I

selected the vmware client dir to start the command.

Even if I write vmware client or

vmware -x client I have the same result : my client doesn’t sart automatically

Источник

Autostart VMware Virtual Machines at Boot in Linux

Do you run VMware Workstation on your Linux machine? I do. A lot. So much in fact that I’ve found it necessary to do things with VMware workstation that it doesn’t do on its own. Maybe in time it will change and add such features, but for now you can’t auto-start VMs on boot. Well, not without some tweaking.

Mind you, there are two ways to do it. One is much more reliable than the other. The first method is quick and dirty and works *most* of the time. You can put the command to start up your VM(s) right in the /etc/rc.local file. But you don’t have any guarantee when it will run during the boot up sequence, and if anything you have in that file ends up failing before the rest of it can execute, you’ve also lost. Here’s an example:

The Ugly Way

Technically You Could Still Put Lipstick On That Pig

Now like I said, you have no guarantee when that command is going to kick off during your boot sequence. In many cases, it will kick off too early and your VM won’t start (because vmware services aren’t fully up yet). You can mitigate that by making a small change, but this still won’t give you the most reliable solution:

But You Can Just As Easily Do Much Better

What you really need is an init script that fits into your boot sequence the way any other startup script would. With an init script (properly written and LSB-compliant) you can make your script depend on other services so that the boot sequence automatically puts it in the right order. And if it fails, you can look in dmesg and syslog to find out what may have gone wrong.

Читайте также:  Фон для терминала linux

Use This Script Instead

But you don’t have an init script? That’s OK. Because I do. I wrote this, tested it, and it works very nicely on Debian/Ubuntu. Save the following script as /etc/init.d/vmware-autostarts. Make it executable (chmod +x /etc/init.d/vmware-autostarts). Customize it as desired with the list of VMs you’d like to autostart, and install it into the bootup sequence like so:

The script below will also auto-stop the VMs as well. If the VMs have VMware tools installed, a graceful shutdown will be possible. Otherwise a hard shutdown will happen. At this point I could go into a long-winded, fully-detailed explanation of what this does. But why? The code is simple, and self-explanatory. Just install it, configure it, and use it. You can call it in stand-alone mode from the command line as well, to test it out beforehand.

NOTE 1: If you use a redhat-based distro version 7+, you’ll probably want to consider converting this to some kind of systemd unit file and run systemctl enable vmware-autostarts && systemctl start vmware-autostarts && systemctl status vmware-autostarts

NOTE 2: If you are using Workstation 12+ on Ubuntu 14.04, one of our readers has pointed out that you should switch the VM_cmd_exec sudo command in the script below to look like: VM_cmd_exec=»sudo vmrun -T ws . «

  • Compile QEMU from source and make a Debian package with CheckInstall
  • apt-get “public key is not available: NO_PUBKEY”
  • The Linux GPG GUI — PGP Key Setup Howto
  • Check The SMART Status Of Your Hard Drives From The Command Line
  • Organize Photos By EXIF Date, or “How To Fix Your Shotwell Library With Perl”
  • Autostart VMware Virtual Machines at Boot in Linux
  • Compiled and Encrypted suid Perl Programs
  • Script to Offline and Remove A Disk In Linux
  • Lacuna Expanse and Team UNSC
  • Animated Gifs on Linux with ffmpeg and imagemagick
  • Lunch With Larry Wall
  • Red Hat, libvirt, KVM, iptables – What to do when your KVM network stops working
  • Load Balancing With Round Robin DNS
  • Convert VDI to VMDK (VirtualBox hard disk conversion to VMware format)
  • Show what users are running processes on your Linux system
  • Encrypt Your Clipboard
  • Allow An Unprivileged User To Run A Certain Command With Sudo
  • If VNC Shows a Gray Background
  • In-Line Search And Replace With Perl Regular Expressions.
  • My Ever-Evolving Bash Profile
  • Remove An IP Address Ban That Has Been Errantly Blacklisted By Denyhosts
  • Monitor Processor Temperature From The Command Line
  • Send An Email When Someone Logs In
  • Save A Vim Session And Then Resume It
  • My .vimrc File

Источник

Enable Virtual Machine AutoStart on VMware Workstation

VMware Workstation and VMware Player do not have a built-in option to automatically start virtual machines when Windows boots up or when a user logs in. If you want the VM to start automatically, you must create an automated task in the Scheduler.

Читайте также:  Nokia lumia 2520 linux

How to Start VMware Workstation/Player VM Using the Task Scheduler?

You can use the vmrun.exe command-line utility to automatically start virtual machines. It is located in the following directory:

  • VMware Workstation: «C:\Program Files (x86)\VMware\VMware Workstation”
  • VMware Player: «C:\Program Files (x86)\VMware\VMware Player\vmrun.exe»

To start a VM from the command line, you must specify the full path to its VMX configuration file. For example

"C:\Program Files (x86)\VMware\VMware Player\vmrun.exe" start "G:\VM\ubuntu1\ubntu1.vmx"

us vmrun.exe command to start VMware VM

Now let’s configure the automatic task scheduler. Open the Windows Task Scheduler console ( taskschd.msc ):

Autostart VMware VM via sheduled task

  1. Select Action ->Create Basic Task;
  2. Specify the task name;
  3. On the Trigger tab, select When the computer starts;
  4. Action -> Start a program;
  5. Paste the full path to vmrun.exe into the Program/Script field: «C:\Program Files (x86)\VMware\VMware Player\vmrun.exe»
  6. Add the arguments: start «G:\VM\ubuntu1\ubntu1.vmx ”
  7. This VM will start automatically when Windows boost.

If you want to start an encrypted VM, you can specify its password using the option: -vp encryptionpasssword .

If you need to start multiple VMs in sequence, create a StartVMs.bat file with the order in which the VMs will be started and run it through the Task Scheduler:

@echo off timeout /t 5 "C:\Program Files (x86)\VMware\VMware Player\vmrun.exe" start "G:\VM\DC1\DC1.vmx" nogui timeout /t 20 "C:\Program Files (x86)\VMware\VMware Player\vmrun.exe" start "G:\VM\ubuntu1\ubntu1.vmx" nogui timeout /t 20 REM Lock Windiws desktop rundll32.exe user32.dll,LockWorkStation

You can also use the vmware.exe file to start the VM. For example, the following command will start the virtual machine and expand its console to the full screen:

“C:\Program Files(x86)\VMware\VMware Workstation\vmware.exe” -X "G:\VM\ubuntu1\ubntu1.vmx"

Configuring Virtual Machine Autostart in VMware Workstation Pro

VMware Workstation Pro 17.0 introduced the option to autostart a VM. When you install this version of VMware Workstation, you will see a new VMware Startup Service appear in Windows.

Set this service to start automatically:

Set-Service VMwareAutostartService –startuptype automatic –passthru

VMware Startup Service in Windows

Then open the VMware Workstation console and navigate to View -> Customize -> Library -> My computer -> Configure Auto Start VMs.

VMware Workstation Pro - Configure Auto Start VMs

Select the virtual machines you want to start automatically when the host OS starts up.

In some cases, an error may occur during configuration:

Failed to update AutoStart configuration. Ensure that the vmAutoStart.xml file exists and you have permissions to write this file.

If you start the VMwareAutostartService service under a specific user account (configured in the Logon tab of the service properties), verify that this user has write permissions to the %ALLUSERSPROFILE%\VMware\VMware Workstation\vmAutoStart.xml file.

Источник

Оцените статью
Adblock
detector