PDA

View Full Version : Could not initialize SDL(No available video device)



nagual_sorcerer07
10-Jan-2015, 00:31
Dear all:
I tried to run qemu-kvm from my gnome-terminal after using a non-root account to locally login my XWindow Desktop.
This is what I did in the gnome-terminal:

sudo /usr/bin/qemu-kvm -m 1024 -name f15 -drive file=/home/joe/Images/FreeDOS-1.1-memstick-2-2048M.img,if=virtio -fsdev local,security_model=passthrough,id=fsdev0,path=/tmp -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=hostshare

However, after I entered the root password, it gave me the following message --

Could not initialize SDL(No available video device) - exiting

Then I realized one of the root causes was because I cannot sudo any gui applications under such conditions. For examples:


[B]xterm Xt error: Can't open display: %s
xterm: DISPLAY is not set

The standard soultion is to use gnomesu, xdg-su, and so on.

But in the qemu-kvm case, apparently it does not work out by using such solutions.

Can any one give me any help?

Thank you anyway.

malcolmlewis
10-Jan-2015, 01:14
On Fri 09 Jan 2015 11:34:01 PM CST, nagual sorcerer07 wrote:


Dear all:
I tried to run qemu-kvm from my gnome-terminal after using a
non-root account to locally login my XWindow Desktop.
This is what I did in the gnome-terminal:

SUDO /USR/BIN/QEMU-KVM -M 1024 -NAME F15 -DRIVE
FILE=/HOME/JOE/IMAGES/FREEDOS-1.1-MEMSTICK-2-2048M.IMG,IF=VIRTIO -FSDEV
LOCAL,SECURITY_MODEL=PASSTHROUGH,ID=FSDEV0,PATH=/TMP -DEVICE
VIRTIO-9P-PCI,ID=FS0,FSDEV=FSDEV0,MOUNT_TAG=HOSTSHARE

However, after I entered the root password, it gave me the following
message --

COULD NOT INITIALIZE SDL(NO AVAILABLE VIDEO DEVICE) - EXITING

Then I realized one of the root causes was because I cannot *sudo*
any gui applications under such conditions. For examples:

[B}sudo xterm[/B]
-XTERM XT ERROR: CAN'T OPEN DISPLAY: %S
XTERM: DISPLAY IS NOT SET-

The standard soultion is to use gnomesu, xdg-su, and so on.

But in the *qemu-kvm* case, apparently it does not work out by using
such solutions.

Can any one give me any help?

Thank you anyway.




Hi
By default sudo isn't configured, you need to go in and configure as
required with visudoers.

Why not use virt-manager?

--
Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.28-4-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below... Thanks!