Project

vmserver

0.0
No commit activity in last 3 years
No release in over 3 years
This gem simplifies the interaction of ruby code with VMServer. You need to have VMServer installed and running to use this gem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

A gem to simplify interaction with VMServer.

Let’s see how to configure and use the gem.
Place all your configuartion in the initialize block.
Now interacting with VMServer should be a piece of cake :)

vmserver = VMServer.new do |vm|
  vm.host             = 'https://xx.xx.xx.xx:8333/sdk'
  vm.vm_user          = 'root'
  vm.vm_password      = 'xxxxxxxx'
  vm.guest_password   = 'xxxxxxxxxx'
  vm.guest_user       = 'administrator'
  vm.datastore        = '[standard] img/img.vmx'
  vm.logging_enabled  = true
end

To start the VMServer

vmserver.start

To stop the VMServer

vmserver.stop

You can also do a hard stop which is equivalent of plugging of the system physically
bc. vmserver.stop(‘hard’)

To create a directory in the Guest OS

vmserver.mkdir('dir')

Example

vmserver.mkdir('c:\test folder\vm server')

To copy a file from Host OS to Guest OS

vmserver.copy_file_from_host_to_guest('src','dest')

Note The src and dest need to be absolute paths.

To list the files under a directory

vmserver.ls('dir')

This will return an array of files

To remove a directory in the Guest OS

vmserver.rmdir('dir')

To remove a file in the Guest OS

vmserver.rmfile('file')

Example

vmserver.rmdir('c:\exampledir')

To run a program in the guest OS

vmserver.run_program_in_guest('path_to_prog',:prog_args => 'if any')

To list processes in guest

vmserver.get_processes_in_guest

This will return an array of processes along with their PIDs

To kill a process in guest

vmserver.kill_process_in_guest('pid')

To take a snapshot of the guest OS

vmserver.capture_screen('path_to_output_file_on_host')