Hide Forgot
> Description of problem: If I do "virt-manager --h" command from ssh shell, I see the following error on the screen. If I do this command from console, it prints the correct print output [root@blade7-rhel6 ~]# virt-manager --h Traceback (most recent call last): File "/usr/share/virt-manager/virt-manager.py", line 455, in <module> main() File "/usr/share/virt-manager/virt-manager.py", line 341, in main import gtk File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in <module> _init() File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init _gtk.init_check() RuntimeError: could not open display > Version-Release number of selected component (if applicable): - Red Hat Enterprise Linux 6.1 > Steps to Reproduce: - Using RHEL 6.1 and ssh with "-X": [wr41th@arkham ~]$ ssh root.1.101 -X root.1.101's password: [root@host01 ~]# virt-manager -h Usage: virt-manager.py [options] Options: --version show program's version number and exit -h, --help show this help message and exit --profile=FILE Generate runtime performance profile stats -c URI, --connect=URI Connect to hypervisor at URI --debug Print debug output to stdout (implies --no-fork) --no-dbus Disable DBus service for controlling UI --no-fork Don't fork into background on startup --no-conn-autostart Do not autostart connections --show-domain-creator Create a new virtual machine --show-domain-editor=UUID Edit a domain configuration --show-domain-performance=UUID Show a domain performance --show-domain-console=UUID Show a domain console --show-host-summary Show a host summary - Using RHEL 6.1 and ssh without "-X": [root@host01 ~]# virt-manager -h ERROR:root:could not open display Traceback (most recent call last): File "/usr/share/virt-manager/virt-manager.py", line 413, in <module> main() File "/usr/share/virt-manager/virt-manager.py", line 285, in main import gtk File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in <module> _init() File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init _gtk.init_check() RuntimeError: could not open display Traceback (most recent call last): File "/usr/share/virt-manager/virt-manager.py", line 420, in <module> _show_startup_error(str(run_e), "".join(traceback.format_exc())) File "/usr/share/virt-manager/virt-manager.py", line 61, in _show_startup_error import gtk File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in <module> _init() File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init _gtk.init_check() RuntimeError: could not open display - Using RHEL 5.5 and ssh without "-X": [root@host02 ~]# virt-manager -h usage: virt-manager.py [options] options: -h, --help show this help message and exit --profile=FILE Generate runtime performance profile stats -c URI, --connect=URI Connect to hypervisor at URI --debug Print debug output to stdout (requires --no-fork) --no-dbus Disable DBus service for controlling UI --no-fork Don't fork into background on startup --no-conn-autostart Do not autostart connections --show-domain-creator Create a new virtual machine --show-domain-editor=UUID Edit a domain configuration --show-domain-performance=UUID Show a domain performance --show-domain-console=UUID Show a domain console --show-host-summary Show a host summary > Additional info: The error happens because the command line arguments are being parsed after the main () tries to run the GTK. There is a difference in main() statement. - RHEL5 in /usr/share/virt-manager/virt-manager.py --snip-- # Run me! def main(): setup_i18n() setup_pypath() (options, ignore) = parse_commandline() setup_logging(options.debug) # Urgh, pygtk merely logs a warning when failing to open # the X11 display connection, and lets everything carry # on as if all were fine. Ultimately bad stuff happens, # so lets catch it here & get the hell out... import warnings warnings.filterwarnings('error', module='gtk') try: --/snip-- - RHEL6 in /usr/share/virt-manager/virt-manager.py --snip-- # Run me! def main(): setup_i18n() setup_pypath() # Urgh, pygtk merely logs a warning when failing to open # the X11 display connection, and lets everything carry # on as if all were fine. Ultimately bad stuff happens, # so lets catch it here & get the hell out... import warnings warnings.filterwarnings('error', module='gtk') try: import gobject # Set program name for gnome shell (before importing gtk, which --/snip-- We can see in RHEL5 virt-manager.py there is the following line getting the command line arguments before to start the GTk. (options, ignore) = parse_commandline() In RHEL6 this line is after: import gtk except Warning, e: # ...the risk is we catch too much though # Damned if we do, damned if we dont :-)( raise RuntimeError(_("Unable to initialize GTK: %s") % str(e)) warnings.resetwarnings() (options, ignore) = parse_commandline() setup_logging(options.debug)
Thanks, fixed upstream: http://git.fedorahosted.org/git?p=virt-manager.git;a=commit;h=ee3e0ba45004859f95eb8a54166bc4aad969b605
Tagging as a regression. Fix is simple and low risk.
Fixed in virt-manager-0.9.0-2.el6
verified with the following components: virt-manager-0.9.0-5.el6.x86_64 libvirt-0.9.4-0rc1.2.el6.x86_64 Steps: 1. # ssh 10.66.3.130 root.3.130's password: Last login: Wed Aug 3 21:14:29 2011 from 10.66.15.50 2. # virt-manager -h Usage: virt-manager [options] ... 3. # ssh 10.66.3.130 -X root.3.130's password: Last login: Wed Aug 3 23:08:54 2011 from 10.66.3.131 4. # virt-manager -h Usage: virt-manager [options] ...
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: No description necessary
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1642.html