How to Start Linux with Gui Without Monitor

How to start linux with gui without monitor?

Your problem is that the X server checks whether there is really a monitor attached. Your options:

  1. Attach a monitor. Simple but wasteful.

  2. Use Xvnc instead. This is like X but it renders to memory, so it doesn't need a graphics card (and no drivers) and no monitor. You can even connect to it remotely via the VNC protocol.

The second option is actually pretty simple to implement: Just call vncserver :42

After export DISPLAY=:42, you can run your Qt application and it will connect to the virtual Xvnc server running on the virtual display 42 (0 is the default).

Running a program with Gui without displaying in Ubuntu

You will need Xvfb to virtualize a X11 server, so first do:

apt-get install xvfb 

You might also need these packages with xvfb:

sudo apt-get install x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps

Then you can run your app like this without any GUI:

Xvfb :19 -screen 0 1024x768x16 &
export DISPLAY=:19
myapp &

run OpenGL program on server without window over ssh

With the current driver models, what you want to do it impossible in a way that works reliably. All the OpenGL implementations that so far exist for Linux absolutely require some kind to window (and be it an invisible, hidden 1×1 pixels small one) to create an OpenGL context.

Note that in the near future with the introduction of Wayland and a larger EGL based, OpenGL infrastructure is about to change. But we are not there yet.

Also if you can live with a slow, software implementation, Mesa has a sidekick library called "OSMesa" that gives you a OpenGL context that renders to a memory region provided by your program. But OSMesa won't use any kind of GPU acceleration.

Qt application GUI -- automatic start -- linux

You very probably need some X window manager to run your Qt application, perhaps even some desktop environment (i.e. you want EWMH & ICCCM compliance), and you obviously need a running X11 server (usually Xorg). So you could manage to have some xinitrc for all that.

Notice that some session -or display- managers like lightdm can be configured to start some special sessions.

In all cases, you need a lot more than just your application to be running, and you certainly need to understand in detail what your Qt application really requires (mostly thru Qt libraries). Learn more about the X11 protocol. See also freedesktop.org.

How to use qemu to run a non-gui OS on the terminal?

You can compile qemu for youself and install it into your home directory. There will be no kernel-mode qemu accelerator, but the qemu will work and the speed will be rather high.

Qemu has two options for non-gui start: http://wiki.qemu.org/download/qemu-doc.html

2.3.4 Display options:

-nographic

  • Normally, QEMU uses SDL to display the VGA output. With this option, you can totally disable graphical output so that QEMU is a simple command line application. The emulated serial port is redirected on the console. Therefore, you can still use QEMU to debug a Linux kernel with a serial console.

-curses

  • Normally, QEMU uses SDL to display the VGA output. With this option, QEMU can display the VGA output when in text mode using a curses/ncurses interface. Nothing is displayed in graphical mode.

Also it can send graphic output to another machine via VNC protocol (-vnc option)

How do you run an application in bash and select which monitor it runs on?

If you run separate displays on each monitor (less likely these days), the DISPLAY environment variable is what you want.

If you use Xinerama (spreading one logical display across multiple monitors), however:

  • Aside: X11 vocabulary: A "display" is one or more "screens" with input devices; e.g. keyboard and mouse, a.k.a. a "seat." A "screen" is a logical canvas that is partially or completely displayed on one or more "monitors;" when using multiple monitors for one "screen," the windows can be partially displayed on each monitor, but share the same X11 DISPLAY identifier; this is called Xinerama. The DISPLAY format is host : display-number . screen-id, so e.g. on my Xinerama set-up both monitors are part of screen 0 on a display number that counts up from 0 with each logged-in user on the same host. "Seats" are logical groups of monitor+input that are using different hardware; multiple "displays" can occur using "virtual console" switching, which is how Gnome and KDE allow multiple users to sign in on a single "seat" machine.

Most GUI toolkits allow you to specify the window's geometry using the --geometry or -geometry switch.

  • Qt uses the older MIT-style -geometry form. GTK+/Gnome uses the GNU-style --geometry.

  • This assumes that you're allowing Qt to post-process your command-line, e.g. passing argv into QtApplication or similar.

The “logical display” will have a resolution which is the sum of the resolutions in each direction of the arrangement of your monitors. For example, I have 2 × 1920×1080 displays hooked up right now. xrandr reports:

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 8192 x 8192

To display a window on the right-hand monitor, I can give a geometry string that has its x co-ordinates between 1920…3839 (inclusive).

The usual format is: width x height ± x-offset ± y-offset ­­— but the width and height are optional, if you prefer to take the defaults. The ± are + to count relative to the top/left, or - to count relative to the bottom/right.

So, for example:

gedit --geometry 800x600+1920+0  # set size at top-left of right screen
gedit --geometry +1920+100 # default size at top-left of right screen
gedit --geometry -0+0 # default size at top-right of entire display

Unfortunately, the only programmatic way I know of to determine the area of the display on each monitor from the shell would be to parse the output from xrandr; e.g.

$ xrandr
Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 8192 x 8192
LVDS1 connected (normal left inverted right x axis y axis)
1366x768 60.0 +
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 287mm
1920x1080 60.0*+
1680x1050 60.0
1280x1024 60.0
1440x900 59.9
1280x720 60.0
1024x768 60.0
800x600 60.3
640x480 60.0
720x400 70.1
HDMI1 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 510mm x 287mm
1920x1080 60.0*+
1680x1050 59.9
1280x1024 60.0
1440x900 59.9
1280x720 60.0
1024x768 60.0
800x600 60.3
640x480 60.0
720x400 70.1
DP1 disconnected (normal left inverted right x axis y axis)

$ xrandr | perl -ne 'if (/(\d+)x(\d+)\+(\d+)\+(\d+)/) '\
> ' { print "$3,$4 - ", $3 + $1 - 1, ",", $4 + $2 - 1, "\n" }'
0,0 - 1919,1079
1920,0 - 3839,1079

(You'd normally want to avoid splitting the Perl one-liner across two lines in the shell, but the '\' trick there is to make it legible on SO.)



Related Topics



Leave a reply



Submit