Check-in [f56bcf1c34]
Not logged in
Overview
Comment:Added documentation for create command options. Added handling of strange situation when spiceurl function is unable to return url from working socket
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f56bcf1c34e58284c3cbc055bdc29bc221b1e1eb
User & Date: vitus on 2016-04-19 14:02:22
Other Links: manifest | tags
Context
2016-05-28
19:19
Fixed autostart command check-in: 4450a86be8 user: vitus tags: trunk
2016-04-19
14:02
Added documentation for create command options. Added handling of strange situation when spiceurl function is unable to return url from working socket check-in: f56bcf1c34 user: vitus tags: trunk
2016-04-15
16:45
Added init script check-in: e5502a4893 user: vitus tags: trunk
Changes

Modified vws from [8063972d8f] to [d944184ea2].

67
68
69
70
71
72
73

74
75
76
77
78
79
80
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81







+







            continue
        idx = line.find("address:")
        if idx != -1:
            url = line[idx+9:]
            if url.startswith('*:'):
                url = "localhost"+url[1:]
    if url is None:
        print >>sys.stderr, "ERROR parsing 'info spice' output:",output
        return None
    return "spice://" + url.rstrip('\r')



def list_bridges():
    """ Return list of bridge network interfaces present in the system """
375
376
377
378
379
380
381




382
383
384
385
386
387
388







389
390
391
392
393
394
395
376
377
378
379
380
381
382
383
384
385
386







387
388
389
390
391
392
393
394
395
396
397
398
399
400







+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+







                    f["type"]=vmtype
                    sock = connect_vm(dirname + "/" + vmname)
                    if sock is None:
                        f.update({"state":"stopped","uri":"-","ip":"-"})
                        f.update(read_netinfo(dirname + "/" + vmname + "/start"))
                    else:
                        uri=spiceurl(sock)
                        if uri is None:
                            f.update({"state":"problem","uri":"None","ip":"-"})
                            f.update(read_netinfo(dirname + "/" + vmname + "/start"))
                        else:
                        f["uri"]=uri[uri.rindex(":")+1:]
                        f.update(get_netinfo(sock))
                        if "ip" not in f:
                            bridges.add(f["iface"])
                        sock.shutdown(socket.SHUT_RDWR)
                        sock.close()
                        f["state"] = "running"
                            f["uri"]=uri[uri.rindex(":")+1:]
                            f.update(get_netinfo(sock))
                            if "ip" not in f:
                                bridges.add(f["iface"])
                            sock.shutdown(socket.SHUT_RDWR)
                            sock.close()
                            f["state"] = "running"
                vms.append(f)
    arp_data={}
    for bridge in bridges:
        arp_data.update(parse_arp(bridge))
    for f in sorted(vms,key=lambda x: x["name"]):
        if "state" in f:
            if "mac" in f and not "ip" in f:

Modified vws.mkd from [1e2a1e51ba] to [5adaaaef70].

89
90
91
92
93
94
95
96

97
98
99
100
101
102
103
89
90
91
92
93
94
95

96
97
98
99
100
101
102
103







-
+







to set up password which lets to connect them via network.

It is allowed to redirect USB devices either via SPICE (i.e. from the
user workplace), or from host where VW is running. ISO images can be
mounted as CDROMs only from host.

VW CREATION
-----------
===========

**vws create** command creates basic layout of the virtual machine -
virtual disk image and startup script and optionally starts installation
process connecting specified ISO-image to virtual CD-ROM drive.

It is also possible to create new machine with copy of existing virtual
drive.
169
170
171
172
173
174
175

























































176
177
178
179
180
181
182

183
184
185
186
187
188
189
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238

239
240
241
242
243
244
245
246







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+






-
+







from your network router. If you use NAT, you'll need to run DHCP
server, for instance **dnsmasq**(8) on your host and make it serve your bridge
interface. You can live without DHCP on bridge, but it would be your
problem to configure IP address on each VW manually. If you are planning
to deploy many VWs with different operating systems, it is better to
have DHCP running.

Options of **vws create** command
---------------------------------

Almost all options of create command can be omitted. In this case,
defaults from **/etc/vws.conf** or **${HOME}/.vwsrc**  would be used.

Typically one needs just **--image** or **--install** option, unless he
wants to alter hardware configuration.

**--no-usb**

  : disable USB controller and USB redirection.

**--no-sound**

  : disable sound card.

**--sound** *cardtype*

  : Use given soundcard model. Can be comma-separated list of card models.  Use  ``qemu-system -soundhw help``  for list of sound cards, supported on your system.

**--arch** *cputype*

  : Emulated architecture. Note that emulation of foreign arch can be very slow.

**--vga** *cardtype*

  : Video card type (cirrus,std,vmware,qxl). Use **qxl** unless you are sure that guest OS doesn't work with it.

**--mem** *size*

  : Size of memory. Can have suffix **M** for megabytes and **G** for gigabytes

**--size** *size*

  : Size of primary disk image to create. Not needed if **--image** is specified.

**--net** *ifname*

  : Network interface name. Typically it is name of bridge interface which would be used to add network interface of virtual machine. Bridge interface must exist before issuing **create** command and preferable should run some DHCP server. Also word **user** can be used instead of bridge name, which means to use QEMU user mode networking.

**--diskif** *type*:

  : Disk interface (virtio, scsi, ide). **virtio** interface is fastest, but some OSes do not support it out of the box. So, you may need to install OS using **ide** or **scsi** interface, then install virtio drivers and then change interface.

**--image** *filename*

  : Existing disk image to import. If this option is specified, primary disk image would be created by importing given image, rather creating new one of specified **--size**. Import would always create a copy, not use original image. Image can have any format, supported by **qemu-img**(1), including VMware and VirtualBox images.

**--shared**

  : Create shared VW instead of private one
  
**--install** *filename.iso*

  : ISO image to install OS from. If this option is specified, virtual machine would be started immediately after creation and given image would be booted from.

USAGE
=====

STARTING AND STOPPING
---------------------

**vws start** \[ **--cdrom** _iso-image_\] \[**--snapshot**\] \[ --no-gui \] *vw-name*
**vws start** \[ **--cdrom** _iso-image_\] \[**--snapshot**\] \[**--no-gui**\] \[**--args** *qemu-args*\] *vw-name*

Starts virtual machine. Optionally, connects specified *iso-image* to
its CD-ROM drive. If **--no-gui** is not specified, starts spice client
(remote-viewer) to connect to this machine. If **--snapshot** is
specified, starts machine in the snapshot mode, i.e. nothing is written
into drive images. You need a lot of space in the */tmp* to run in
snapshot mode.