RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1038496 - No error shows when launch virt-manager from host via ssh without X forwarding
Summary: No error shows when launch virt-manager from host via ssh without X forwarding
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-manager
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Giuseppe Scrivano
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-05 08:31 UTC by tingting zheng
Modified: 2014-06-18 00:01 UTC (History)
7 users (show)

Fixed In Version: virt-manager-0.10.0-10.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 11:14:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description tingting zheng 2013-12-05 08:31:33 UTC
Description
No error shows when launch virt-manager from host via ssh without X forwarding

Version:
virt-manager-0.10.0-7.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. Install virt-manager
2. Connect to a remote host via ssh without X forwarding
# ssh root@$ip
3. Execute virt-manager,no error shows and virt-manager is not launched.
# virt-manager

When add --debug option,the info shows as:
# virt-manager --debug
2013-12-05 15:58:51,543 (cliutils:75): virt-manager startup
2013-12-05 15:58:51,543 (virt-manager:201): Launched as: ['/usr/share/virt-manager/virt-manager', '--debug']
2013-12-05 15:58:51,544 (virt-manager:202): virt-manager version: 0.10.0
2013-12-05 15:58:51,544 (virt-manager:203): virtManager import: <module 'virtManager' from '/usr/share/virt-manager/virtManager/__init__.pyc'>
2013-12-05 15:58:51,693 (virt-manager:249): GTK version: 3.8.4

(virt-manager:22170): Gtk-CRITICAL **: gtk_icon_theme_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
2013-12-05 15:58:51,699 (virt-manager:55): Error starting virt-manager
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager", line 308, in <module>
    main()
  File "/usr/share/virt-manager/virt-manager", line 270, in main
    icon_theme.prepend_search_path(cliconfig.icon_dir)
AttributeError: 'NoneType' object has no attribute 'prepend_search_path'
2013-12-05 15:58:51,718 (cliutils:87): Uncaught exception:
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager", line 316, in <module>
    _show_startup_error(str(run_e), "".join(traceback.format_exc()))
  File "/usr/share/virt-manager/virt-manager", line 63, in _show_startup_error
    debug=False)
  File "/usr/share/virt-manager/virtManager/error.py", line 86, in show_err
    buttons=buttons)
  File "/usr/share/virt-manager/virtManager/error.py", line 189, in __init__
    Gtk.MessageDialog.__init__(self, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/gi/overrides/Gtk.py", line 519, in __init__
    **kwds)
  File "/usr/lib64/python2.7/site-packages/gi/overrides/Gtk.py", line 446, in __init__
    Gtk.Dialog.__init__(self, **kwds)
  File "/usr/lib64/python2.7/site-packages/gi/overrides/Gtk.py", line 416, in __init__
    raise RuntimeError("Gtk couldn't be initialized")
RuntimeError: Gtk couldn't be initialized

Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager", line 316, in <module>
    _show_startup_error(str(run_e), "".join(traceback.format_exc()))
  File "/usr/share/virt-manager/virt-manager", line 63, in _show_startup_error
    debug=False)
  File "/usr/share/virt-manager/virtManager/error.py", line 86, in show_err
    buttons=buttons)
  File "/usr/share/virt-manager/virtManager/error.py", line 189, in __init__
    Gtk.MessageDialog.__init__(self, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/gi/overrides/Gtk.py", line 519, in __init__
    **kwds)
  File "/usr/lib64/python2.7/site-packages/gi/overrides/Gtk.py", line 446, in __init__
    Gtk.Dialog.__init__(self, **kwds)
  File "/usr/lib64/python2.7/site-packages/gi/overrides/Gtk.py", line 416, in __init__
    raise RuntimeError("Gtk couldn't be initialized")
RuntimeError: Gtk couldn't be initialized


Actual results:
As step 3 describes.

Expected results:
A user friendly error message shows,eg:"There is no display available to execute virt-manager. DISPLAY is not set."

Additional info:
The issue can not be reproduced on rhel 6, and there is bug 1025706 on rhel 6 to ask for a more friendly error message.

Comment 3 zhengqin 2013-12-11 03:04:56 UTC
I retest this issue with build virt-manager-0.10.0-8.el7:

Currently, following error will display:
--------------------------------------------
Gtk couldn't be initialized: Could not open display:
--------------------------------------------


Need info for 2 points for your patch:
 
1. The command line will hang after Error display, and the user need press "Enter" to go back command line;
2. Is the Colon at the end after word "display" necessary? 


Thanks.

Comment 4 Cui Lei 2013-12-24 02:51:39 UTC
According comment3, change the bug status to assigned.
Giuseppe, would you please have a check for the needinfo?

Comment 5 Giuseppe Scrivano 2013-12-24 09:41:01 UTC
1. cannot be changed (at least not so easily to accept it at a so late stage), virt-manager forks another process before open the display and the forked process will display that message.

2 can be fixed, the last part should be showed only when DISPLAY is set.

Comment 8 hyao@redhat.com 2014-01-17 02:46:01 UTC
Verified the bug based on the following steps:

# rpm -qa virt-manager
virt-manager-0.10.0-11.el7.noarch
# virt-manager --no-fork

** (virt-manager:2740): WARNING **: Could not open X display
Gtk couldn't be initialized

Comment 9 Ludek Smid 2014-06-13 11:14:09 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


Note You need to log in before you can comment on or make changes to this bug.