~alan-griffiths/mir/knee-jerk-mir_surface_state_automatic

« back to all changes in this revision

Viewing changes to doc/using_mir_on_pc.md

  • Committer: Alan Griffiths
  • Date: 2013-03-11 17:42:55 UTC
  • mfrom: (484 trunk)
  • mto: This revision was merged to the branch mainline in revision 494.
  • Revision ID: alan@octopull.co.uk-20130311174255-bjyo3a90v71entgq
Segregate server-only code

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Using Mir on a PC {#using_mir_on_pc}
 
2
=================
 
3
 
 
4
Before you begin
 
5
----------------
 
6
 
 
7
Before you can use Mir you need to ensure you have the proper custom Mesa build
 
8
installed. If you installed Mir using the packages from mir-team staging PPA
 
9
(see \ref installing_prebuilt_on_pc), you should be good to go.
 
10
 
 
11
If you built Mir from source code (see \ref building_source_for_pc), you need
 
12
to ensure you are using the proper Mesa at runtime. You can do that by
 
13
installing the Mesa packages manually from the staging PPA, or by building the
 
14
custom Mesa yourself and ensuring it can be found by mir, e.g., by using
 
15
LD_LIBRARY_PATH.
 
16
 
 
17
Using Mir as system compositor with X
 
18
-------------------------------------
 
19
 
 
20
Note: for this to work you need to have Mir and all its dependencies (which
 
21
include lightdm, Mesa and the Xorg drivers). The easiest way is to install
 
22
pre-built packages from the staging PPA.
 
23
 
 
24
To run X sessions under Mir, with Mir acting as the system compositor, edit
 
25
your /etc/lightdm/lightdm.conf to look to look like this:
 
26
 
 
27
    [SeatDefaults]
 
28
    user-session=ubuntu
 
29
    greeter-session=unity-greeter
 
30
    type=mir
 
31
 
 
32
Now restart lightdm:
 
33
 
 
34
    $ sudo service lightdm restart
 
35
 
 
36
In theory, you should now find yourself back in Ubuntu and not notice
 
37
anything different. You can verify you're in mir several ways:
 
38
 
 
39
    $ ps aux | grep mir
 
40
    $ grep -i xmir /var/log/Xorg.0.log
 
41
    $ ls -l /var/log/lightdm/mir.log
 
42
 
 
43
Running Mir natively
 
44
--------------------
 
45
 
 
46
You can also run Mir natively. To do so, log in to VT1 (Ctrl+Alt+F1) _after_
 
47
you are already logged in to X.  If you do so before then you will not be
 
48
assigned adequate credentials to access the graphics hardware and will get
 
49
strange errors.
 
50
 
 
51
Note that you can switch back to X using Alt+F7. But it is very important to
 
52
remember NOT to switch once you have any mir binaries running. Doing so will
 
53
currently make X die (!).
 
54
 
 
55
Now we want to run the mir server and a client to render something. The trick
 
56
is that we need to make sure the mir server is easy to terminate before ever
 
57
switching back to X. To ensure this, the server needs to be in the foreground,
 
58
but starting before your client (in the background). To do this, you must:
 
59
 
 
60
    $ (sleep 3; some-mir-client) & mir ; kill $!
 
61
 
 
62
Wait 3 seconds and the client will start. You can kill it with Ctrl+C. REMEMBER
 
63
to kill the mir processes fully before attempting to switch back to X or your X
 
64
login will die.
 
65
 
 
66
In case you accidentally killed your X login and ended up with a failsafe
 
67
screen, you might find on subsequent reboots you can't log in to X at all any
 
68
more (it instantly and silently takes you back to the login screen).  The fix
 
69
for this is to log in to a VT and:
 
70
 
 
71
    $ rm .Xauthority
 
72
    $ sudo restart lightdm
 
73
 
 
74
Getting some example client applications
 
75
----------------------------------------
 
76
 
 
77
If you installed mir using the packages from the mir-team staging PPA, you can
 
78
get some example programs by installing the `libmirclient-demos` package:
 
79
 
 
80
    $ sudo apt-get install libmirclient-demos
 
81
 
 
82
If you are building from source you can find client applications in the bin/
 
83
subdirectory of the build directory.