Index: find_free_port.mkd ================================================================== --- find_free_port.mkd +++ find_free_port.mkd @@ -24,6 +24,6 @@ SEE ALSO ======== -**netstat**(8), **vws**(1) +**vws**(1), **socket**(2), **bind**(2), **listen**(2) Index: vws ================================================================== --- vws +++ vws @@ -168,10 +168,13 @@ print spiceurl(options.sock) def cmd_start(options): """ vws start """ + if not "DISPLAY" in os.environ: + # If cannot start GUI just don't do it. + options.gui = False if options.stopped: arg = "" if options.cdrom: arg = " -cdrom " + os.path.abspath(options.cdrom[0]) if options.snapshot: @@ -209,15 +212,15 @@ "VM is already running") if options.cdrom: options.file = options.cdrom[0] options.id = None cmd_cdrom(options) + uri = spiceurl(options.sock) if options.gui: - uri = spiceurl(options.sock) os.system((config.get('tools', 'viewer') + "&") % uri) elif not options.stopped: - print >>sys.stderr, "VM already running" + print >>sys.stderr, "VM already running use uri %s" % uri def cmd_stop(options): """ vws stop """ if snapshot_mode(options.sock) or options.hard: try: