You are not logged in.

#1 2019-11-29 14:49:33

zetta
Member
Registered: 2019-04-03
Posts: 8

[Solved] Xorg not working on VirtualBox

I am posting this solution to my own problem here.

I wanted to run Arch on VirtualBox using i3 as window manager. I did a pretty standard Arch installation.

When it came to Xorg, I did: pacman -S xorg xorg-xinit xterm virtualbox-guest-utils xf86-video-vmware

I also did: cp /etc/X11/xinit/xinitrc ~/.xinitrc
(I want to run X as non-root user.)

When running startx now, the X server would start just fine. However, after rebooting, I get various error messages when running startx:

- xf86enableioports failed to set iopl for i/o (operation not permitted)
- Fatal server error: (EE) AddScreen/ScreenInit failed for driver 0
- xinit: unable to connect to X server: Connection refused
- modeset(0): drmSetMaster failed: Permission denied

Funnily enough, startx worked as root user.


What fixed it for me: I added the "nomodeset" kernel parameter:

vim /etc/default/grub
=> GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"
grub-mkconfig -o /boot/grub/grub.cfg

Now after rebooting Xorg finally worked for me.

You can check the current kernel parameters with: cat /proc/cmdline

Last edited by zetta (2019-11-29 15:03:41)

Offline

#2 2019-11-29 15:59:43

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,769

Re: [Solved] Xorg not working on VirtualBox

What are you using as a host?   It has been a while since I have used VB, so I won't be much help here;  Now I use qemu when the host is Linux, and I mostly use Linux services for Windows when I am on a Windows Box.   I am pretty sure that when I used it I never had to use nomodeset -- and I always use i3wm.   Just a suggestion, but I think you have found a workaround and not a solution.  Perhaps those more familiar with VB can help find a better solution.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2019-11-30 14:02:10

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: [Solved] Xorg not working on VirtualBox

- xf86enableioports failed to set iopl for i/o (operation not permitted)
- Fatal server error: (EE) AddScreen/ScreenInit failed for driver 0
- xinit: unable to connect to X server: Connection refused
- modeset(0): drmSetMaster failed: Permission denied

Probably not a VB issue, search for - modeset(0): drmSetMaster failed: Permission denied and you'll find several things to try that can solve this without crippling graphics capabilities like nomodeset does.

Last edited by Lone_Wolf (2019-11-30 14:02:33)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2019-12-02 09:08:52

zetta
Member
Registered: 2019-04-03
Posts: 8

Re: [Solved] Xorg not working on VirtualBox

You were right that this was a workaround instead of a solution. I had further issues like modprobe vboxvideo would fail.

I googled a lot for "modeset(0): drmSetMaster failed: Permission denied". What finally helped was this:

pacman -S polkit

Now everything seems to be working fine.

Last edited by zetta (2019-12-02 13:59:45)

Offline

#5 2019-12-02 13:59:35

zetta
Member
Registered: 2019-04-03
Posts: 8

Re: [Solved] Xorg not working on VirtualBox

Self reply.

Since I wanted to use the VirtualBox guest additions for automatic display resizing, I set the graphics controller of the VM to VBoxVGA.

Now I had the problem again that I could start Xorg as root but not as user when running startx.

What I noticed: When I install a display manager such as LXDM and configure LXDM to run at boot time, then I can log into Xorg as normal user.

I still do not understand what the root cause is. But at least it is working now using a display manager.

Last edited by zetta (2019-12-02 14:14:47)

Offline

#6 2019-12-03 11:45:15

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: [Solved] Xorg not working on VirtualBox

Rootless Xorg relies on kernel mode setting & logind .

If the driver doesn't support KMS, rootless xorg fails .
Display Manager don't use rootless Xorg at all.

Does VboxVga have a kernel module that supports KMS ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2019-12-03 13:51:24

kermit63
Member
Registered: 2018-07-04
Posts: 173

Re: [Solved] Xorg not working on VirtualBox

I recently created an arch linux vm on arch linux host to do some experimentation.

It is a rather vanilla arch install with xfce DE but no display manager. I've done a few of these vms in the past and can always invoke xfce just by entering startxfce4 as a non-root user. However, in this case, I found that I needed to invoke startxfce4 as root.

Anyway, I noticed that the only difference between this install and previous ones was the presence of "loglevel=3" in the GRUB_CMDLINE_LINUX_DEFAULT statement of the /etc/default/grub file. I removed "loglevel=3" and was able to invoke xfce as non-root as before.

I didn't really think much about it, just proceeded with my intended experiment, and deleted the VM after successfully carrying out my experiment.

I didn't tweak any of the VM settings and merely accepted the defaults, except creating a 16G virtual drive, and setting networking to bridged.

-----------------------

I'm not an advanced user, so I'm not certain what the implication of removing "loglevel=3" on the overall system, and certainly not advocating that users should just remove it. Just sharing this info in case it helps shed light on the problem.

Offline

#8 2019-12-10 10:35:00

bachtiar
Member
Registered: 2005-02-08
Posts: 65

Re: [Solved] Xorg not working on VirtualBox

Please check if this applies to you:

https://bugs.archlinux.org/task/64383

Offline

#9 2020-01-12 23:49:09

czipperz
Member
Registered: 2015-03-29
Posts: 3
Website

Re: [Solved] Xorg not working on VirtualBox

zetta wrote:

pacman -S polkit

This worked for me even though polkit was already installed.  Weird.

Last edited by czipperz (2020-01-12 23:50:09)


Czipperz
Email: czipperz@gmail.com
Website: czipperz.github.io

Offline

Board footer

Powered by FluxBB