CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Discussions related to using VirtualBox on Linux hosts.
GioMBG
Posts: 18
Joined: 28. Jun 2017, 18:46

CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by GioMBG »

Hi All,
I need to install Virtualbox on a normal server machine with a MINIMAL CentOS Linux release 7.3.1611 (Core)
I make all the install procedure without any fail or warning and I think most of the installation has been successful because when I run the setup I receive :

Code: Select all

[root@swinger ~]# /usr/lib/virtualbox/vboxdrv.sh setup
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: Starting VirtualBox services.
BUT when I try to run from root or normal user :

Code: Select all

VirtualBox
I receive:

Code: Select all

Qt FATAL: QXcbConnection: Could not connect to display 
Annullato (core dumped)
around I've see that maybe I get this error because I don't have any serverX installed so I've install

Code: Select all

yum install xorg-x11-server-Xorg
and always I receive the same Qt FATAL error...
any suggestions ?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by Perryg »

Running virtualbox invokes the GUI manager and since you have a minimal server install it will fail just like you say. Servers require you to run headless and that is described in the manual.

7.1.2. VBoxHeadless, the remote desktop server
GioMBG
Posts: 18
Joined: 28. Jun 2017, 18:46

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by GioMBG »

hi Perryg,
thanks for the link and sorry if I've omitted to write that I'm REALLY newbie in fact of Virtualbox,

Code: Select all

VBoxManage startvm "VM name" --type headless
"VM name" what I've to input here ? an user name or what ?
when I try input an user as

Code: Select all

VBoxManage startvm horse --type headless
I receive :

Code: Select all

VBoxManage: error: Could not find a registered machine named 'horse'
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "FindMachine(Bstr(pszVM).raw(), machine.asOutParam())" at line 573 of file VBoxManageMisc.cpp
of course I try to found another match in the guide about "VM name" to understand what is request but I don't found...
any suggestions ?
always thanks
Gio
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by Perryg »

You need to read the entire section. After you have installed VirtualBox the next step is to create the guest (7.1.3. Step by step: creating a virtual machine on a headless server). I don't know your reason for cutting your teeth with VirtualBox and on a headless server but it can be difficult until you learn both Linux (cli) and VirtualBox. The VirtualBox steps are provided but the actual logic of doing this on Linux is another matter.
GioMBG
Posts: 18
Joined: 28. Jun 2017, 18:46

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by GioMBG »

hi Perryg,
of course always is better to read everything,
kindly thanks to take a look to my procedure, I'm just happy to have come to a status where I've never been...

Code: Select all

[root@swinger ~]# VBoxManage createvm --name "Win7" --ostype Windows7_64 --register
Virtual machine 'Win7' is created and registered.
UUID: 097f12c6-7b74-483e-83c1-c1ce9d51b7ee
Settings file: '/root/VirtualBox VMs/Win7/Win7.vbox'

[root@swinger ~]# VBoxManage modifyvm "Win7" --memory 2048 --acpi on --nic1 nat

[root@swinger ~]# VBoxManage createhd --filename "Win7.vdi" --size 5000
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: e5af9e9e-98ab-476d-945e-66a0e4c6d1ea

[root@swinger ~]# VBoxManage storagectl "Win7" --name "IDE Controller" --add ide --controller PIIX4

[root@swinger ~]# VBoxManage storageattach "Win7" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium "Win7.vdi"

[root@swinger ~]# VBoxManage storageattach "Win7" --storagectl "IDE Controller" --port 0 --device 1 --type dvddrive --medium /root/Win7iso.iso

[root@swinger ~]# VBoxManage modifyvm "Win7" --vrde on

[root@swinger ~]# VBoxHeadless --startvm "Win7"
Oracle VM VirtualBox Headless Interface 5.1.26
(C) 2008-2017 Oracle Corporation
All rights reserved.

ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4850:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4850:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4850:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4371:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4850:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default
I have to install an audio driver ? suggestion ?

In my root I've put a NORMAL original DVD Win7 installer successfully ripped as .iso (/root/Win7iso.iso)
QUESTION: maybe I've to point to a specific .iso for virtualbox or can be good what I've ripped from original Win DVD ?

Newbie Question ( sorry maybe premature ) : after what I have to do to login to my Win7 virtual ?

always THANKS ( really ) !
Gio
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by Perryg »

Your audio issue should be taken care of with.

Code: Select all

VBoxManage modifyvm <vm name> --audio none
You should also post the guests log file so we can see any more issues.

Note: I really don't help users that insist on running in root. It is very dangerous and there is no security at all.
GioMBG
Posts: 18
Joined: 28. Jun 2017, 18:46

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by GioMBG »

hi Perryg,
yes of course I stay in root only to install virtualbox
thanks for the --audio none suggestion was ok !
going normal user "horse" I receved a problem maybe with the groups

Code: Select all

[horse@swinger ~]$ VBoxHeadless --startvm "Win7"
Oracle VM VirtualBox Headless Interface 5.1.26
(C) 2008-2017 Oracle Corporation
All rights reserved.

Invalid machine name or UUID!

[horse@swinger ~]$ 
suggestions ?
always thanks
Gio
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by Perryg »

By installing and creating the guest in root you now have permission problems. Normally you install as the user with an elevated terminal ( su or sudo ) and create the guest as you with the files stored in your user profile.
GioMBG
Posts: 18
Joined: 28. Jun 2017, 18:46

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by GioMBG »

hi Perryg,
yes of course, normally when I install a new machine from zero I go quite "easy" making all the installations processes test, I save on a text all the GOOD operations and after I re-install all the server from zero omitting all the experiments and avoiding re-install something not user-full to make the maximum light possible machine, of course respecting the safes procedure...
just redo all in "horse" user

Code: Select all

[horse@swinger ~]$ VBoxHeadless --startvm "Win7"
Oracle VM VirtualBox Headless Interface 5.1.26
(C) 2008-2017 Oracle Corporation
All rights reserved.

X <- Cursor flashes intermittently
is fine ?

In this user "horse" I've put a NORMAL original DVD Win7 installer successfully ripped as .iso (/root/Win7iso.iso)
QUESTION: maybe I've to point to a specific .iso for virtualbox or can be good what I've ripped from original Win DVD ?

Newbie Question ( sorry maybe premature ) : after what I have to do to login to my Win7 virtual ?[/quote]

always thanks
Gio
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by Perryg »

/root/VirtualBox VMs/Win7/Win7.vbox
This is what I was talking about. No one but root has permissions to read/write in this location. So it is normal that it fails when running as a normal user.

As for the creation of an ISO, yes it should work "IF" the ISO was created correctly, but here again the location (--type dvddrive --medium /root/Win7iso.iso) will be impossible for a normal user
GioMBG
Posts: 18
Joined: 28. Jun 2017, 18:46

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by GioMBG »

Good day Perryg
REALLY thanks for your Precious Support and for Your Kind.
Yes of course, I agree 100% with positioning .iso out of root.

is this situation (Cursor flashes intermittently under) normal ?

Code: Select all

[horse@swinger ~]$ VBoxHeadless --startvm "Win7"
Oracle VM VirtualBox Headless Interface 5.1.26
(C) 2008-2017 Oracle Corporation
All rights reserved.

X <- Cursor flashes intermittently
always thanks
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by Perryg »

It depends. If the storage location is the same as before ( under root ), then yes it could be normal since the normal user will not has read/write access. In headless mode you will not see any response on the host since it is not running as far as the tty window is concerned. All of the interaction with the guest will be done remotely with a client.

Note: So far all of your questions have been about the normal use of Linux which is outside of the scope of this forum. I asked you why the need to run headless to learn VirtualBox at the beginning but never got a reply. Any reason, or is this all an exercise?
GioMBG
Posts: 18
Joined: 28. Jun 2017, 18:46

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by GioMBG »

hi Perryg,
now the location .iso is:

Code: Select all

horse@swinger ~]# VBoxManage storageattach "Win7" --storagectl "IDE Controller" --port 0 --device 1 --type dvddrive --medium /home/horse/Win7iso.iso
sorry if I don't answer to your Note,
I need to run some virtual windows in a CentOS server where I have BIG band and traffic available: is NOT an exercise :)

what I have to discover now is how to login from a local Windows to this CentOS Virtalbox"ed" Win7... ( I make another post ? )

always thanks
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by Perryg »

It's all described in the link I sent you. Just stay here to keep it all in a combined location. Just to be clear here, ask VirtualBox questions please.
GioMBG
Posts: 18
Joined: 28. Jun 2017, 18:46

Re: CentOS Minimal 7.3: Qt FATAL: QXcbConnection: Could not connect to display

Post by GioMBG »

Hi Perryg,
I've try to setup virtualbox to acept external connections :

Code: Select all

VBoxManage setproperty vrdeauthlibrary "VBoxAuthSimple"
VBoxManage modifyvm "Win7" --vrdeauthtype external
test hash :
VBoxManage setextradata "Win7" "VBoxAuthSimple/users/horse" MyPasswd = 0123456789...
VBoxManage setextradata "Win7" "VBoxAuthSimple/users/horse" 0123456789...
all these input come fine and without any warning...

I've try to connect with a mac using :
address: the ip of the machine where is virtualbox
username : horse
passwd : 0123456789...

Code: Select all

Unable to connect to remote PC. Please provide the fully-qualified name or the IP address of the remote PC, and then try again.
where I've wrong ?
always thanks
Post Reply