Artifact [4cb8c5829f]
Not logged in

Artifact 4cb8c5829f11889a2d655e252af46004c8c87bb0:

Wiki page [Concepts] by vitus on 2017-01-14 16:04:59.
D 2017-01-14T16:04:59.259
L Concepts
N text/x-markdown
P 7768da8a2ee0a485678d7f9605657a33898191d4
U vitus
W 5314
Concepts
========

Use **vws** script.
-------------------

Although there is **start** script in the directory of virtual machine, which is theoretically can be used to start machine without **vws** script, most operations witb virtual workstations should be done via **vws**.

You can edit **start** script direcrtly and add options **vws** doesn't know about yet, but it should be done with care - **vws** might parse and edit this script. We would take as much care as we can to preserve user modifications.

There are also things in the **start** script which should be kept intact or **vws** would be unable to perform some operations - such as attach cdrom on start.

Note that vws start command is able to pass arbitrary qemu optyions.

If you want to send commands to qemu monitor, preferrable way to do so is 

```
vws monitor
```

command. It interacts nicely with other qemu commands, so you can be sure that if you use some **vws** command while monitor is open, it would not break things.

Start brings you GUI
--------------------

By default, if user have DISPLAY variable defined, **vws start** command starts spice client. If it finds, that machine is already running, it just starts the client, If not, it starts machine and than client.

So **vws start** *machine* actually means «I want console of this virtual machine on this screen».

Console is set of devices
-------------------------

When you connect to console of virtual machine, you get not only picture on your screen and ability to send keyboard and mouse events. By default, vws virtual machines have emulated sound card and sounds are forwarded to client.
Also by default, at least one USB device on the client machine can be redirected to VM. When **vws usb** command operates with server devices, i.e. devices on machine where VM is running, spice-client allows to redirect devices from the machine where user sits.

Remote access
-------------

By default, vws virtual machines listen for spice connection on loopback interface only. Of course, you always can use ssh port forwarding if you want to access spice GUI of machine, you've not started for remote use.

But if you start machine with environment SPICE_PASSWORD defined, it binds to all interfaces and allows access to anybody who knows this password.

Option **--password** for **vws start** command does this. But it cannot change configuration of already started machine. If qemu monitor allows to change password interactively, it doesn't allow to change list of interfaces spice server listen on.

If you want some machine to always start in the network-accessable mode, you can define SPICE_PASSWORD directy in the machine's **start** script. It is only way to allow network access for autostart VMs.


Personal and shared VMs
-----------------------

**vws** supports personal and shared VMs. By default, **vws create** creates personal vm in the ~/VWs. If you want to create shared VM, use **--shared** option.

~/VWs may be symlink to another partition where there is enough space for virtual machines.

If you want to share already created VM, just move it to shared VMs directory, as specified in /etc/vws.conf and chgrp it to vm_group (as specified in the same file). You should be able to do so without superuser rights, because shared VM directory should be writable to vm_group (if vws is properly set up) and you must be member of this group to use kvm at all.

VMs are created group writable anyway, both shared and personal. It does no harm to have personal VMs group-writable, because modern Linuxes have personal group for  each user.

Autostart VMs
-------------

Sometimes it is desirable that some VMs start upon system bootup. In **vws** autostart VMs are considered shared.

/etc/vws.conf lists two directories for shaed vms 
SharedVMs and AutostartVMs. VMs in first directory should be started explicitely one by one using **vws start** command.

VMs in the second one are started at once by **vws autostart**.

vws distribution provides init.d script for system V init and service file for systemd, to autostart machines.

Note that there also is **vws shutdown** command which tries to stop any running VM it finds - shared or personal, autostarted or not. 


Creating Virtual Machines
=========================

There are reasonable defaults for almost all machine parameters in the 
```/etc/vws.conf```. So, you just speciy those parameters you want to change.

Importing images from other systems
-----------------------------------

VM in **vws** consists of at least disk image and start script.
So, if you want to use VM disk  image  created by some other virtualization system (virsh, oVirt, VirtualBox, VMWare), you have to *create VM from existing image*. 

Just specify your image in the **--image** option of create command, and it would be converted from its original format to qemu qcow2 format and start file would be written.

Creating VMs by installation from ISO image
-------------------------------------------

If you specify ISO image via **--install** option to **vws create**, newly created virtual machine would be started immediately and given image attached to its virtual CD-ROM drive, so installation process starts.


Z 4ce6bb2c9ada771d3b0935e7d5466f48