1 2 Previous Next 24 Replies Latest reply on Nov 11, 2010 2:47 PM by WoodyZ Go to original post
      • 15. Re: vmware - scripting the vm creation, and os installation process
        WoodyZ Guru
        badouglas11 wrote:

          however, when i run the test, i'm getting the gui from the  iso/kickstart/vmplayer, so how can i "turn off"/disable the graphical output.

         

        Use vmrun with the nogiu parameter to start the VM.

        • 16. Re: vmware - scripting the vm creation, and os installation process
          badouglas11 Enthusiast

          hi woody etal

           

          my question had to do with when i run the vmplayer, that creates the

          VM/installs the OS.

           

          During the create/install process, the vmplayer/kickstart process

          displays user input gui/dialogs that require the user input. I need to

          figureout a way of running the entire process without requiring any

          user input.

           

          also, i have the vmplayer app, but not the vmrun app...

           

          thanks

          • 17. Re: vmware - scripting the vm creation, and os installation process
            WoodyZ Guru

            I normally do not use Easy Install however IIRC after inputting the information for the Easy Install process and then starting the install there was no addition user interaction necessary the install process went through to completion.  So assuming you first do a normal install with Easy Install in order to get the necessary support files to replicate the process through automation I don't see what the issue is.  You know sometimes you just have to observe the process and then reverse engineer it so to speak.  Also there is a parameter you can add to the .vmx configuration file that will suppress GUI Prompts and auto answer with the best choice in some cases.  Sorry don't remember it off the top of my head at the moment however its been mentions many times before in these forums.

             

            As far as vmrun is concerned it comes as a part of VMware Workstation and for VMware Player you can download it from the page you downloaded VMware Player from.  It's called VMwareVIX and have a look at: Using vmrun to Control Virtual Machines

             

            Just curious have you tried using Google to find out some of this information or have you look at the Documentation section on VMware Player and VMware Workstation?  Did you even type vmrun in Google?

             

            I'm not trying to be a hard ass however you need to do more research as all of this has already been covered before and I'm sure it out there on the Internet.

            • 18. Re: vmware - scripting the vm creation, and os installation process
              badouglas11 Enthusiast

              hey woody...

               

              you're not being a hardass... and i've looked high/low on the net for

              this data prior to coming here. also called vmware to talk to presales

              which didn't help, so yeah, i think i';ve done the homework.

               

              now, you're free to say that maybe someone without a certain skill

              level in this area should be dealing with this, and that's your right.

               

              but the basic data that i've been searching for wasn't apparent to me.

               

              might be quite apparent to you, but you have a different

              background/understanding than i in this area.

               

              now, having said that, i think the basic issue that I'm now facing is

              how (if it's possible) to start creating a VM from a script, pointing

              to the OS.

               

              If it's not possible, then I'll create a process that goes like this:

               

              1) create the initial "seed" VM using the GUI, specifying an OS (Rhel/Centos)

              2) use the autoinst.iso, as well as the vmx to create all the future

              VMs with the

                   specific OS

                2a) I can mount/modify the files in the autoinst.iso based on the current OS,

                      and then recreate (mkisofs) a new copy of the autoinst.iso for the

                      creation of the new VM

              3) once I create the new base VM, the process can then insert the

              required files

                   into the VM, via ssh/scp (scripts) etc..

              4) the results of this process should be a valid/scripted VM that

              then runs on the

                   client env

               

              I can then repeat steps 2-4 in a script/program/cli approach for

              every additional VM

               

              Thoughts/comments welcome.

              • 19. Re: vmware - scripting the vm creation, and os installation process
                WoodyZ Guru

                I notice you didn't explicitly answer the questions I asked however that's okay.

                 

                I've not seen a single document that encompasses complete step by step directions from start to finish for what you're trying to do nonetheless the information is out there and just has to be pulled together based on the tools being used and ability of the one doing the work.

                 

                Okay, as a Proof of Concept exercise I scripted the process of creating the virtual hard drive, the .vmx configuration file, and then starting the install process without the GUI and brought the VM to a shutdown upon completion of the OS and VMware Tools install. I did not create the autoinst.iso file via scripting although it certainly is possible and I have and do create other bootable iso images via scripts however I just didn't have time to script that portion for this particular case although I did customize the kickstatrt configuration file in order to have the VM shutdown after the install and used the default autoinst.iso with my customized KS.CFG file as a seed to get this done. Then after the install when starting the VM normally for the first time I did not have to deal with the normal message the would come up because of what I'd call a shortcoming in the Easy Install process however that could be fixed with additional scripting so as not to use the 'msg.autoAnswer = "TRUE"' parameter although that's not a bad parameter to have in the .vmx file and it just depends on ones needs/preferences/wants.

                 

                JSYK I did this on a Mac using a simple Bash Script and VMware Fusion however it absolutely can also be done using VMware Player under Windows as an example however with VMware Player you'll have to get vmware-vdiskmanager from VMware Workstation if you plan to create the virtual hard disk by command line.  You'll also need vmrun which is available in the VIX package you can download from where you downloaded VMware Player or I guess you can grab that from Workstation too.

                 

                So here is an outline of one way and what you'll need...

                 

                If you're fine with a default CentOS Easy Install then just use the autoinst.iso from a VM created by the VMware Product GUI as part of what will be needed to script the entire process or you can create a custom Kickstart Configuration file and use the customized elements with the one created by a default CentOS Easy Install however you'll need to delete the original KS.CFG file in the autoinst.iso replacing it with your customized KS.CFG file.

                 

                I added additional Packages to my KS.CFG file because I'm going to keep the VM from this exercise however the line to modify in the original to have the VM shutdown after the install of the OS and VMware Tools is simply changing 'telinit 5' to 'telinit 0'.  At a minimum this should be done if being done without a GUI and is more conducive to additional scripting to test for the completion of the install if developing a more complex scrip than the simple bash scrip I used here.

                 

                To add additional Packages I use Kickstart Configurator from another Linux VM to create a customized configuration and then just took the %packages section and blended it with the original from the autoinst.iso file.

                 

                Note: A customized autoinst.iso can be created via scripting using mkisofs in conjunction with the files from the original autoinst.iso and a customized KS.CFG file created via scripting and all done on the fly however this is more complicated then just modifying the original with a customized KS.CFG file and using it as the seed and I just don't have time to do that now for this exercise.

                 

                For the virtual hard disk again you can use the one create by a CentOS Easy Install as the seed or you can get vmware-vdiskmanager from VMware Workstation so you can create the virtual hard disk in the script.

                 

                With the support files in place it just a matter of writing the scrip and I've attached the one I created for this exercise so you can see what took place.  Obviously the way this is written once executed and because no GUI is in play you have to check by other means that the actual install is finished and the VM is shutdown (the vmware-vmx process) however this is just additional coding to monitor the process and notify when complete and while I didn't do this in this script nonetheless it's doable and again I don't have the time to add it as this was mainly being done simply for Proof of Concept so you'd know it can be done.

                 

                File Attached: createvm.zip

                • 20. Re: vmware - scripting the vm creation, and os installation process
                  badouglas11 Enthusiast

                  hey woody...

                   

                  you are da' man!

                   

                  pretty much everything that you provided is what i had/have created,

                  and been testing.

                   

                  although, a couple of points.

                   

                  1) when i had downloaded vmrun from the VIX download, I kept getting

                  an error implying that workstation wasn't installed. (Didn't really

                  look into whether I'd need to download/install workstation to overcome

                  this)

                  2) when looking into the vmx from the vmplayer, I didn't find the

                  "'msg.autoAnswer = "TRUE" attribute.

                    (I assume that there are valid atributes that I haven't seen as of yet)

                   

                   

                  thanks much!!

                  • 21. Re: vmware - scripting the vm creation, and os installation process
                    WoodyZ Guru

                    I'm quite sure VIX can be installed without VMware Workstation and I've done in on VMware Player only installs.  I tested a Windows version of the script on a system that had only VMware Player and VIX and it started the VM without the GUI however I terminated the vmware-vmx process via Task Manager as I didn't have the disk space the let the install complete on that system.

                     

                    What is the file name of the VIX package you downloaded?

                     

                    The 'msg.autoAnswer = "TRUE"' parameter is one that has always had to be added manually and was the one I couldn't remember off the top of my head the other day.  Yes there are many parameters that are unpublished by VMware although are out there.  continuum's website is the best unofficial source for unpublished by VMware parameters.

                    • 22. Re: vmware - scripting the vm creation, and os installation process
                      badouglas11 Enthusiast

                      Hi Woody.

                       

                      The bundle I downloaded for the VIX was

                      VMware-VIX-1.10.1-266898.x86_64.bundle. I'm running fedora13 / 64bit.

                       

                      when ran the vmrun:

                      vmrun '-T player' start /a1.vmx

                       

                      I get the error. Others on the net reported getting the same err as well.

                       

                      -thanks

                      • 24. Re: vmware - scripting the vm creation, and os installation process
                        WoodyZ Guru

                        I just tested on a Linux system and had to run the VMware-VIX-1.10.1-266898 install twice.  It fail the first time without any message in the log file.

                         

                        After a successful install I ran a .vmx without first editing the /usr/lib/vmware-vix/vixwrapper-config.txt file and got the error message expected about the specified version not found and then after editing it I was able to run the .vmx using vmrun nogui.

                        1 2 Previous Next