[Updated: JUN 15] Easier XMir Setup (Now with Libertine!)

Search This thread

ShadowEO

Senior Member
Mar 15, 2012
490
133
63
28
Columbus, Ohio
EDIT: I bring you the new OFFICIAL way of installing X11 applications, I've been neglecting this thread way too much and need to give it some love.

The old instructions (OLD METHOD) are no longer needed as of April on the rc and rc-proposed channels, this should work on all channels however (tested up to latest devel-proposed image)

NOTE: You still need a writable image for the first parts of this, after you install the tools, it can go back to read-only.

1) Open Terminal
2) Install the following packages: libertine libertine-tools python3-libertine-chroot
3) Open the Ubuntu Store and install the scope: libertine-scope
4) Open the Libertine application that's now available in your launcher and follow instructions, it will set up a Ubuntu Vivid chroot in your home directory, install the components needed, and drop you at the package management screen. From here, you can update and add PPAs to the container via the Settings Icon -> Manage Container, Install packages via the plus icon, etc.
5) Favorite the Libertine XApps scope by swiping up on the home screen and hitting the star, then open the scope and you'll see any applications you installed there.

If you cannot install your container via the Libertine application (I know that it didn't have support for chroot until recently, not sure if that version has landed yet), you can install your container via the teminal, so open your terminal but DO NOT sudo su. All Libertine-container-manager commands MUST be done as phablet.

To create a container (this line will likely change when Xenial drops as Libertine will be switching to LXC on Xenial):
Code:
libertine-container-manager --create -i <container id> -n <friendly name (this shows up in the Libertine app)> -t chroot
Using this command, the system will build the new libertine container, wait until it's finished and then you can continue by using the installed Libertine application.

Onscreen Keyboard in Libertine Applications
THIS CAN FINALLY BE DONE! The only con to it, is that it is mostly unusable in applications that open dialog boxes along the bottom of the screen, the XMir window does not scroll up like native applications do to give a better viewing window. (I have been told that this will change in OTA-12 when the keyboard support drops for Libertine/Puritine apps)

To install on-screen keyboard:
Open Libertine and add ppa:brandontschaefer/maliit to your container. Then hit update in Manage Containers. Once done, install the following, maliit-inputcontext-gtk2, maliit-inputcontext-gtk3, maliit-framework. After that, setup is complete in your container, now we need to do some extra work outside the container to make it pass the GTK_IM_MODULE variable we need over to Libertine. To do this, add this line to your .bashrc or if you have a writable image, you can add this to the systemwide profile (not sure if this will be replaced on OTA though):

Code:
export GTK_IM_MODULE=maliitphablet
Restart the tablet OS, Open an application such as Libreoffice Writer and BEHOLD!

Notes
You can also manage your container via the terminal with libertine-container-manager. To get a root shell without installing mate terminal (You can't get a root shell via this method (installing a term), Proot acts like fakeroot all over your container's rootfs), you can use the following:
- l-c-m exec -c bash (This command does not mount any user directories (/home/phablet will not exist) and is best used for making changes to the container's rootfs)
or if you only need a user shell:
- DISPLAY= libertine-launch <containerid (default is vivid)> bash (This mounts user directories, but is no different than if you installed something like mate-terminal and ran it. The reason we are passing an empty DISPLAY variable is because libertine-launch will refuse to start if DISPLAY isn't set, even it if doesn't exist.)
- DPI Hacks: To change the DPI of applications in Libertine, you need a new way to make the .Xdefaults file as only the XDG User directories get mounted inside the libertine container, not your entire Home. To do this, install your favorite editor inside of the libertine container (I find nano to be the easiest for new users), and open Terminal, then follow these instructions:
1) Open your editor to ~/.local/share/libertine-container/user-data/[my container id, default = vivid]/.Xdefaults and fill it with the following:
Code:
Xft.dpi: 175
or what your preferred DPI is. On the Nexus 7 flo the comfortable DPI is 175 with an application font size of 14 (I use Liberation Sans which comes from Libreoffice).
- You can make your applications look great still, you don't have to be stuck with the default Raleigh GTK style. Download and install LXAppearance in your container and add ppa:noobslab/themes then start installing themes. Enjoy! The Ubuntu Touch Themes are wonderful and FlatPlat works well with the system UI as well.

Some cons to this:
- It requires at least 3GBs available in your internal storage (wherever your home folder resides) to store a full, non-touch Ubuntu Vivid container.

Pros:
- It survives OTAs, the only thing able to break this would be a change to XMir, PRoot, or Libertine. Which is landing in the images shortly by default so there's not much of a chance to break this.
- Nothing you do will break your UTouch system. Unlike the old method, this only installs the items needed to run the container, which are to become standard inside the images very soon.


OLD METHOD
--------------------
EDIT: I have not tested this in stable, rc, rc-proposed yet. Only the dev-proposed channel.

So there is some questioning I see going on about how to run things like Firefox efficiently and well. So I figured I'd write up a little something for it.

First you'll want to set your DPI in ~/.Xdefaults, as I have a Nexus 7, mine looks similar to this:
Xft.dpi: 240

Note that you may need to do some additional tweaking.
Now that you have Xdefaults made, install the ubuntu-pocket-desktop and matchbox-window-manager packages (along with the program you wish to use, for this tutorial, I'll use libreoffice).

Create a file in /bin called wm-wrapper.sh (or whatever you choose here, just remember the name), fill it with:
Code:
#!/bin/bash
matchbox-window-manager -use_titlebar no -use_dialog_mode const-horiz &
exec [email protected]
and save it, then chmod a+x it.

EDIT: For this next part, I recommend copying the .desktop to ~/.local/share/applications to avoid them being overwritten on package updates.
Now, navigate to /usr/share/applications/ and open the .desktop file for the application you are wanting to run. Add the following lines under [Desktop]:
Code:
X-Ubuntu-Touch=true
X-Ubuntu-XMir-Enable=true

Change the Exec line so that your wrapper (in my case wm-wrapper.sh) is in front of the executable, such that the line becomes (or similar):
Code:
Exec=/bin/wm-wrapper.sh libreoffice %U

Save it, then search for your application in the Unity Scopes. Open it up and you should see your application running as an XMir app easy. For future applications, you will simply need to do the changes to it's .desktop file.

EDIT: A helpful redditor gave me this tip to enable sending touch events over to Xmir. Setting the GTK_TEST_TOUCHSCREEN environment variable to 1 will apparently remove hover events and the like (events that are not normally sent with a touch screen, but with a mouse). I have not had time to take a look at this yet however so YMMV.
 
Last edited:

ShadowEO

Senior Member
Mar 15, 2012
490
133
63
28
Columbus, Ohio
Thanks man, gonna try this on my n4 later today.

No problem, Like I said, not sure if it works on other channels, but it works great on the dev-proposed channel. You will also want to close applications using their menu items as closing the Xmir root window will cause the application to terminate without asking to save anything. Libreoffice can get around this via Document Recovery though.

I had been working on this for a good solid week testing applications and different ways to get X11 applications working so I could make it a full workstation, so I figured why not post my findings since the Ubuntu forum doesn't seem to get much love.
 

doniks

Senior Member
Jul 15, 2014
70
11
28
Thanks for the matchbox tip! It works quite nicely, especially, it brings a nice onscreen keyboard with it. I use the following setup now:

  • ~/.local/share/applications/gedit-mb.desktop
    Code:
    [Desktop Entry]
    Name=GEdit in Matchbox
    Type=Application
    Terminal=false
    Icon=/usr/share/gedit/logo/gedit-logo.png
    X-Ubuntu-Touch=true
    #X-Ubuntu-XMir-Enable=true 
    Exec=/home/phablet/bin/matchbox-wrapper.sh gedit
  • ~/bin/matchbox-wrapper.sh
    Code:
    #!/bin/bash
    export DISPLAY=:1
    Xmir $DISPLAY &
    sleep 1
    # xlogo
    # xeyes
    # x11vnc -forever -nopw -quiet -display $DISPLAY &
    matchbox-window-manager &
    sleep 1
    matchbox-keyboard &
    [email protected]
  • ~/.matchbox/kbdconfig
    Code:
    # http://unix.stackexchange.com/questions/223110/what-are-the-keyboard-shortcuts-for-matchbox-window-manager
    <ctrl><alt>p=prev
    <ctrl><alt>n=next
    <ctrl><alt>d=!matchbox-desktop
    <ctrl><alt>x=!xterm
    <ctrl><alt>f=!firefox

Together with the Xft.dpi setting (I use 220) this gives me a quite usable editor. If you have any other tips ShadowEO, I'd love to hear them!
 

ShadowEO

Senior Member
Mar 15, 2012
490
133
63
28
Columbus, Ohio
Do you have a specific example? Which application are you looking at?

Sorry, for some reason I wasn't subscribed to this post (weird.)

Anyway the specific application I was looking at was gedit, when started with the native GDK Mir backend, it is almost unusable with touch as the elements are so small. GDK_SCALE doesn't work and neither does any of the GTK dconf settings for scaling.

Also, I have switched to using rc-proposed, so any more changes I do will likely be able to be installed without worrying about the snapshot channel.

Also messing with some touch-screen specific .gtk2.0-rc entries seem to help, but since I reformatted, I don't quite have those offhand at the moment. I'll have to look them up again.
 
Last edited:

takri

New member
Apr 5, 2016
2
0
0
Hi!
Thanks a lot for all these useful explanations! Finally I was able to run Firefox on my bq E4.5 (rc-proposed)! But I have a few questions:
1) I don't have any on-screen keyboard
2) it works like with a mouse (no touch scrolling for instance)
Is there something I can do about that?
 

ShadowEO

Senior Member
Mar 15, 2012
490
133
63
28
Columbus, Ohio
Hi!
Thanks a lot for all these useful explanations! Finally I was able to run Firefox on my bq E4.5 (rc-proposed)! But I have a few questions:
1) I don't have any on-screen keyboard
2) it works like with a mouse (no touch scrolling for instance)
Is there something I can do about that?

You could try the touchegg package for multi touch gestures, I haven't gotten around to testing it yet. As for keyboard, you can use onboard for most applications or if the application is a QT application, it will pop up the system keyboard (behavior was exhibited by calibre)
 

takri

New member
Apr 5, 2016
2
0
0
You could try the touchegg package for multi touch gestures, I haven't gotten around to testing it yet. As for keyboard, you can use onboard for most applications or if the application is a QT application, it will pop up the system keyboard (behavior was exhibited by calibre)

Thanks a lot for your answer. Sorry I don't know much yet about all this so my questions might be silly!
1) I installed touchegg but I don't know how to make it work
2) I have no keyboard in any app I installed (caja, gedit, firefox, ...)

Another question: I have a bq E4.5 and although I have 3.5G of free space on my internal memory the space available for apt-get-ed apps is much smaller (I have 50M left after installing just those few apps above). So no way to try libreoffice or other heavier app. Do you know if there is a solution for that?

Thank you very much!
 

doniks

Senior Member
Jul 15, 2014
70
11
28
2) I have no keyboard in any app I installed (caja, gedit, firefox, ...)
If you use the matchbox setup I described above then you should have a keyboard.

Another question: I have a bq E4.5 and although I have 3.5G of free space on my internal memory the space available for apt-get-ed apps is much smaller (I have 50M left after installing just those few apps above). So no way to try libreoffice or other heavier app. Do you know if there is a solution for that?

This website describes a tweak to put the apt cache on an external SD card. It's in German, but the command lines should be clear enough. Let us know how it goes.
https://wiki.ubuntuusers.de/Ubuntu_Touch/Terminal/#Freien-Speicher-beobachten
 

ShadowEO

Senior Member
Mar 15, 2012
490
133
63
28
Columbus, Ohio
You would need to run touchegg in the wrapper. Sadly wth keyboard, the only applications that will get the system keyboard are QT based applications. GTK+ and other applications will require onboard to be installed. I messed around with trying to install maliit-context-gtk2 to get the system keyboard to show in all apps, but that broke the keyboard completely.

Remember XMir is better used with a physical keyboard since it doesn't trigger the Ubuntu keyboard for everything.

You can also make the system img bigger if using MultiROM: you simply run e2fsck -fp /path/to/Ubuntu.IMG and resize2fs <target size> /path/to/Ubuntu.IMG.
 
  • Like
Reactions: rbradley274

doniks

Senior Member
Jul 15, 2014
70
11
28
You would need to run touchegg in the wrapper.

I've played around with this a bit, but I can't get touchegg to work. I start an xmir application, then log in via ssh from my desktop. After setting the DISPLAY variable, I can start more X applications ok. After starting touchegg I see an output like this:

Code:
Reading config from  "/home/phablet/.config/touchegg/touchegg.conf" 
Try to make a multitouch gesture. If everything goes well the information about the gesture must appear 
[+] Avaliable gesture: 
         Name ->  Flick 
[+] Avaliable gesture: 
         Name ->  Drag 
[+] Avaliable gesture: 
         Name ->  Pinch 
[+] Avaliable gesture: 
         Name ->  Rotate 
[+] Avaliable gesture: 
         Name ->  Tap 
[+] Avaliable gesture: 
         Name ->  Touch

I assume that I am supposed to see some more output when a touch gesture is recognised by touchegg, but nothing ever shows up.

I can see touch events with either xinput or evtest

Code:
$ xinput test "xmir-fake-touch-pointer:0"
motion a[0]=36317 a[1]=42290 
button press   1 
motion a[0]=36590 a[1]=41730 
motion a[0]=36645 a[1]=41275 
motion a[0]=36536 a[1]=40469 
motion a[0]=36263 a[1]=39524 
motion a[0]=35935 a[1]=39034 
motion a[0]=34897 a[1]=38019 
motion a[0]=33532 a[1]=36934 
motion a[0]=32713 a[1]=36303 
motion a[0]=31839 a[1]=35778 
motion a[0]=31293 a[1]=35533 
motion a[0]=30856 a[1]=35323 
motion a[0]=30638 a[1]=35253 
motion a[0]=30419 a[1]=35148 
motion a[0]=30255 a[1]=35078 
motion a[0]=29928 a[1]=34903 
motion a[0]=29873 a[1]=34868 
motion a[0]=29873 a[1]=34868 
motion a[0]=29873 a[1]=34868 
button release 1
Code:
$ evtest /dev/input/event0
Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "elan-touchscreen"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
  Event type 3 (EV_ABS)
    Event code 47 (ABS_MT_SLOT)
      Value      0
      Min        0
      Max        9
    Event code 48 (ABS_MT_TOUCH_MAJOR)
      Value      0
      Min        0
      Max       31
    Event code 53 (ABS_MT_POSITION_X)
      Value      0
      Min        0
      Max     1343
    Event code 54 (ABS_MT_POSITION_Y)
      Value      0
      Min        0
      Max     2239
    Event code 57 (ABS_MT_TRACKING_ID)
      Value      0
      Min        0
      Max    65535
    Event code 58 (ABS_MT_PRESSURE)
      Value      0
      Min        0
      Max      255
Properties:
  Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)
Event: time 9936.473027, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1159
Event: time 9936.473088, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 12
Event: time 9936.473088, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 27
Event: time 9936.473118, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 338
Event: time 9936.473118, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1059
Event: time 9936.473149, -------------- SYN_REPORT ------------
Event: time 9936.509709, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 11
Event: time 9936.509709, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 43
Event: time 9936.509709, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 351
Event: time 9936.509739, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1061
Event: time 9936.509739, -------------- SYN_REPORT ------------
Event: time 9936.512791, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 46
Event: time 9936.512791, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 357
Event: time 9936.512791, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1063

Some websites point to synclient for the configuration of touchegg, but that doesn't seem to work in Xmir:

Code:
$ synclient 
Couldn't find synaptics properties. No synaptics driver loaded?

Does anyone else have more luck with touchegg?

While researching it, I stumbled over references to xSwipe, but I haven't looked into that any further.

You would need to run touchegg in the wrapper. Sadly wth keyboard, the only applications that will get the system keyboard are QT based applications. GTK+ and other applications will require onboard to be installed. I messed around with trying to install maliit-context-gtk2 to get the system keyboard to show in all apps, but that broke the keyboard completely.


Just to reiterate, the matchbox-keyboard works fine for me!
 

ShadowEO

Senior Member
Mar 15, 2012
490
133
63
28
Columbus, Ohio
I completely forgot the matchbox keyboard while writing that reply, I'm not sure what's going on with touchegg as I haven't had a chance to play with it on Ubuntu touch. It could be that XMir isn't actually passing that much information about touch events.
 

eskizon

New member
Oct 19, 2013
2
1
0
matchbox-window-manager struggle

I am on the new Aquarius m10 Ubuntu tablet.

Tried to run tome applications and realized the X11 and Mir problem.

Came across your solution! Thank you for sharring!

Well, I dont seem to be able to install matchbox-window-manager
It shows a lot of missing dependencies and I am not abble to install them manually either.. :(

The following packages have unmet dependencies:
matchbox-window-manager : Depends: libmatchbox1 (>= 1.7-1) but it is not going to be installed
Depends: libstartup-notification0 (>= 0.2) but it is not going to be installed
Depends: libxsettings-client0 but it is not going to be installed

Any light?? Thank you very much
 

doniks

Senior Member
Jul 15, 2014
70
11
28
I am on the new Aquarius m10 Ubuntu tablet.

Tried to run tome applications and realized the X11 and Mir problem.

Came across your solution! Thank you for sharring!

Well, I dont seem to be able to install matchbox-window-manager
It shows a lot of missing dependencies and I am not abble to install them manually either.. :(

The following packages have unmet dependencies:
matchbox-window-manager : Depends: libmatchbox1 (>= 1.7-1) but it is not going to be installed
Depends: libstartup-notification0 (>= 0.2) but it is not going to be installed
Depends: libxsettings-client0 but it is not going to be installed

Any light?? Thank you very much
Mhm, not sure. You do have set it to read-write and you did an apt update, right?
 

Tazard4

New member
May 31, 2009
3
0
0
Mhm, not sure. You do have set it to read-write and you did an apt update, right?

Thanks for sharing this info! I also own the M10 ubuntu tablet and try to run some X11 apps.
I am able to apt-get matchbox-window-manager. But it won't start and says it can't find the display.
Running either:
Code:
matchbox-window-manager
matchbox-window-manager -d :0
as a normal user or root always returns: "can't open display! check your DISPLAY variable.".

ubuntu-pocket-desktop is up to date and I also set the DPI in ~/.Xdefaults.

What could be the reason it can't find the display? What could I try?
 

ShadowEO

Senior Member
Mar 15, 2012
490
133
63
28
Columbus, Ohio
Bumping this thread as I've edited the OP with the official instructions for running Legacy X Applications on Ubuntu Touch. As well as information about getting the system maliit-based OSK showing in X Applications (It's not that great though, you still may have better luck with matchbox-keyboard/on-board, but not sure how you'd even start those in Libertine.)
 
  • Like
Reactions: doniks

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    EDIT: I bring you the new OFFICIAL way of installing X11 applications, I've been neglecting this thread way too much and need to give it some love.

    The old instructions (OLD METHOD) are no longer needed as of April on the rc and rc-proposed channels, this should work on all channels however (tested up to latest devel-proposed image)

    NOTE: You still need a writable image for the first parts of this, after you install the tools, it can go back to read-only.

    1) Open Terminal
    2) Install the following packages: libertine libertine-tools python3-libertine-chroot
    3) Open the Ubuntu Store and install the scope: libertine-scope
    4) Open the Libertine application that's now available in your launcher and follow instructions, it will set up a Ubuntu Vivid chroot in your home directory, install the components needed, and drop you at the package management screen. From here, you can update and add PPAs to the container via the Settings Icon -> Manage Container, Install packages via the plus icon, etc.
    5) Favorite the Libertine XApps scope by swiping up on the home screen and hitting the star, then open the scope and you'll see any applications you installed there.

    If you cannot install your container via the Libertine application (I know that it didn't have support for chroot until recently, not sure if that version has landed yet), you can install your container via the teminal, so open your terminal but DO NOT sudo su. All Libertine-container-manager commands MUST be done as phablet.

    To create a container (this line will likely change when Xenial drops as Libertine will be switching to LXC on Xenial):
    Code:
    libertine-container-manager --create -i <container id> -n <friendly name (this shows up in the Libertine app)> -t chroot
    Using this command, the system will build the new libertine container, wait until it's finished and then you can continue by using the installed Libertine application.

    Onscreen Keyboard in Libertine Applications
    THIS CAN FINALLY BE DONE! The only con to it, is that it is mostly unusable in applications that open dialog boxes along the bottom of the screen, the XMir window does not scroll up like native applications do to give a better viewing window. (I have been told that this will change in OTA-12 when the keyboard support drops for Libertine/Puritine apps)

    To install on-screen keyboard:
    Open Libertine and add ppa:brandontschaefer/maliit to your container. Then hit update in Manage Containers. Once done, install the following, maliit-inputcontext-gtk2, maliit-inputcontext-gtk3, maliit-framework. After that, setup is complete in your container, now we need to do some extra work outside the container to make it pass the GTK_IM_MODULE variable we need over to Libertine. To do this, add this line to your .bashrc or if you have a writable image, you can add this to the systemwide profile (not sure if this will be replaced on OTA though):

    Code:
    export GTK_IM_MODULE=maliitphablet
    Restart the tablet OS, Open an application such as Libreoffice Writer and BEHOLD!

    Notes
    You can also manage your container via the terminal with libertine-container-manager. To get a root shell without installing mate terminal (You can't get a root shell via this method (installing a term), Proot acts like fakeroot all over your container's rootfs), you can use the following:
    - l-c-m exec -c bash (This command does not mount any user directories (/home/phablet will not exist) and is best used for making changes to the container's rootfs)
    or if you only need a user shell:
    - DISPLAY= libertine-launch <containerid (default is vivid)> bash (This mounts user directories, but is no different than if you installed something like mate-terminal and ran it. The reason we are passing an empty DISPLAY variable is because libertine-launch will refuse to start if DISPLAY isn't set, even it if doesn't exist.)
    - DPI Hacks: To change the DPI of applications in Libertine, you need a new way to make the .Xdefaults file as only the XDG User directories get mounted inside the libertine container, not your entire Home. To do this, install your favorite editor inside of the libertine container (I find nano to be the easiest for new users), and open Terminal, then follow these instructions:
    1) Open your editor to ~/.local/share/libertine-container/user-data/[my container id, default = vivid]/.Xdefaults and fill it with the following:
    Code:
    Xft.dpi: 175
    or what your preferred DPI is. On the Nexus 7 flo the comfortable DPI is 175 with an application font size of 14 (I use Liberation Sans which comes from Libreoffice).
    - You can make your applications look great still, you don't have to be stuck with the default Raleigh GTK style. Download and install LXAppearance in your container and add ppa:noobslab/themes then start installing themes. Enjoy! The Ubuntu Touch Themes are wonderful and FlatPlat works well with the system UI as well.

    Some cons to this:
    - It requires at least 3GBs available in your internal storage (wherever your home folder resides) to store a full, non-touch Ubuntu Vivid container.

    Pros:
    - It survives OTAs, the only thing able to break this would be a change to XMir, PRoot, or Libertine. Which is landing in the images shortly by default so there's not much of a chance to break this.
    - Nothing you do will break your UTouch system. Unlike the old method, this only installs the items needed to run the container, which are to become standard inside the images very soon.


    OLD METHOD
    --------------------
    EDIT: I have not tested this in stable, rc, rc-proposed yet. Only the dev-proposed channel.

    So there is some questioning I see going on about how to run things like Firefox efficiently and well. So I figured I'd write up a little something for it.

    First you'll want to set your DPI in ~/.Xdefaults, as I have a Nexus 7, mine looks similar to this:
    Xft.dpi: 240

    Note that you may need to do some additional tweaking.
    Now that you have Xdefaults made, install the ubuntu-pocket-desktop and matchbox-window-manager packages (along with the program you wish to use, for this tutorial, I'll use libreoffice).

    Create a file in /bin called wm-wrapper.sh (or whatever you choose here, just remember the name), fill it with:
    Code:
    #!/bin/bash
    matchbox-window-manager -use_titlebar no -use_dialog_mode const-horiz &
    exec [email protected]
    and save it, then chmod a+x it.

    EDIT: For this next part, I recommend copying the .desktop to ~/.local/share/applications to avoid them being overwritten on package updates.
    Now, navigate to /usr/share/applications/ and open the .desktop file for the application you are wanting to run. Add the following lines under [Desktop]:
    Code:
    X-Ubuntu-Touch=true
    X-Ubuntu-XMir-Enable=true

    Change the Exec line so that your wrapper (in my case wm-wrapper.sh) is in front of the executable, such that the line becomes (or similar):
    Code:
    Exec=/bin/wm-wrapper.sh libreoffice %U

    Save it, then search for your application in the Unity Scopes. Open it up and you should see your application running as an XMir app easy. For future applications, you will simply need to do the changes to it's .desktop file.

    EDIT: A helpful redditor gave me this tip to enable sending touch events over to Xmir. Setting the GTK_TEST_TOUCHSCREEN environment variable to 1 will apparently remove hover events and the like (events that are not normally sent with a touch screen, but with a mouse). I have not had time to take a look at this yet however so YMMV.
    1
    You would need to run touchegg in the wrapper. Sadly wth keyboard, the only applications that will get the system keyboard are QT based applications. GTK+ and other applications will require onboard to be installed. I messed around with trying to install maliit-context-gtk2 to get the system keyboard to show in all apps, but that broke the keyboard completely.

    Remember XMir is better used with a physical keyboard since it doesn't trigger the Ubuntu keyboard for everything.

    You can also make the system img bigger if using MultiROM: you simply run e2fsck -fp /path/to/Ubuntu.IMG and resize2fs <target size> /path/to/Ubuntu.IMG.
    1
    Bumping this thread as I've edited the OP with the official instructions for running Legacy X Applications on Ubuntu Touch. As well as information about getting the system maliit-based OSK showing in X Applications (It's not that great though, you still may have better luck with matchbox-keyboard/on-board, but not sure how you'd even start those in Libertine.)
    1
    Dear shadowEO,
    I'm a ubuntu/Linux noob.
    I read the treats out of intrest and I really want to give this (x-mir, libertine) a try on my mx4.
    Would you be offended if I ask a "noob proof how to"?
    (still strugling with the terminal. I already was proud of myself for changing the background via terminal)

    YaaBaa1986, Ask and ye shall receive. I'm a very accommodating person, so asking for help does not offend me one bit. However you may find these to be a bit hard to use on the MX4 without an external display.

    Unfortunately, it seems in the latest version of Libertine, the app is once again broken when it comes to making a container and installing applications, so you will need to use Terminal for it.

    But a nice noob proof howto (provided your system image is writable):
    1) Open terminal and sudo su.
    2) When you see the # in your prompt, you're executing as root, this is good for this stage. If your system image is not writable yet, type
    Code:
    touch /userdata/.writable_image
    and reboot. When the system starts back up, continue from a root prompt (Step 1)
    3) In terminal as root, type apt-get update && apt-get install libertine python3-libertine-chroot and press enter. It will install some packages to your system image. Once the package is complete, type exit to go back to an unprivileged prompt (prompt will be suffixed with $, this is the prompt for your user account and is needed for the next steps, libertine does not run under root or sudo)

    4) Now it's time to create your container, so at your normal terminal prompt, type the following (you can change it if you'd like, this is an example)
    Code:
    libertine-container-manager -i vivid -n Applications -t chroot
    , It will begin running debootstrap to create your libertine container, let it run. If this does not work, you will need an ubuntu laptop to use phablet-shell or adb shell, but phablet shell is preferred, for this step (Libertine seems to hate running under the Unity 8 terminal application due to AppArmor's confinement).

    5) After your container has been created and installed and you are back at your prompt, you can begin to load applications into it. To do so, use the following command
    Code:
    libertine-container-manager install-package -i vivid -p <package name>
    NOTE: If you changed the container ID ( -i vivid ) in the creation step, you will need to substitute it here as well. The -p parameter is only good for ONE package at a time (dependencies don't count, but you can't do something like "libreoffice default-jre", you need to install libreoffice and default-jre separately)

    6) If you need to remove a package, you can use the following command:
    Code:
    libertine-container-manager remove-package -i vivid -p <package name>

    Got your container all ready to go with your apps installed? But how do you start them? Easy. Go back to the Apps Scope and open the Ubuntu Store, search for Libertine Scope and install it, then swipe up from the home screen and you'll see a new "XApps" scope, this contains your applications.

    Noob-easy DPI hack:
    So the screen looks UBER small to you? That's fine, it does for most of us, open your terminal and follow the below:

    1) In terminal, type or paste the following (you can paste by long-holding on the screen):
    Code:
    nano /home/phablet/.local/share/libertine-container/user-data/vivid/.Xdefaults

    This will provide you with an empty editor ready for things to be entered. Type the following (NOTE, this is personal preference, tweak it till you're happy and follow the notes below for getting it looking better):
    Code:
    Xft.dpi: 175

    To make your applications look better instead of the default Raleigh theme, use the commands above to install the lxappearance package and follow these instructions to add the NoobsLab Themes PPA:

    1) From a normal prompt, type
    Code:
    libertine-container-manager configure -a ppa:noobslab/themes
    Once done, type
    Code:
    libertine-container-manager update

    2) To search through themes available for installation type
    Code:
    libertine-container-manager search-cache -s noobslab -i vivid
    which is functionally the same as apt search noobslab. The use the l-c-m install-package command above to install the themes you find.

    3) Once done, go to the XApps scope and open LXAppearance and you'll see your themes there. If you have any applications open already, you will need to close them and reopen to get them to pick up the new settings.

    Note: If you install libreoffice, I would suggest changing the Default font in LXAppearance to Liberation Sans 13pt.

    For On-Screen Keyboard, install the packages maliit-inputcontext-gtk2 and maliit-inputcontext-gtk3. Next time you open a GTK+ application you should see the system keyboard in the X applications.

    Whew, I hope that helps :D If it does I'll move this over to the OP and replace the horrible instructions I wrote up in a hurry yesterday.

    By the way, how did you get the wallpaper to change via Terminal? I've been trying with gsettings so I could make a wallpaper sync system between my PC and the tablet, but when I use gsettings, it just doesn't change.
    1
    Niiice writeup ShadowEO. Thanks!
    I'm using the following ~/.local/share/applications/keyboard.desktop to add the matchbox keyboard to a running X application:



    With the script being simply


    ---------- Post added at 10:29 AM ---------- Previous post was at 10:11 AM ----------



    The terminal access and the bind mounts do really confuse me in the libertine setup. As you say lcm exec -c bash gives you a root shell into the chroot. I'm pretty sure I have messed up my first chroot container though simply by using apt install in this shell, so I'm not sure this is a stable, supported access into the chroot.

    What is mate terminal? Do you know what libertine is based on? proot? chroot? Schroot? Fakeroot. Could you elaborate a bit more what is mounted where and how one can find out?

    What I would prefer most is if I could get a user shell as phablet into the chroot and then be able to do sudo. But maybe I have some wrong expectations about chroots. Afterall, what exactly is the difference btw "root" and another user if the whole root filesystem has been created with user rights?!

    Anyway, the only stable shell as user, is what I get by installing xterm into the container, the start the xterm, then add the matchbox keyboard. A veeery roundabout way for shell access :(

    ---------- Post added at 10:49 AM ---------- Previous post was at 10:29 AM ----------



    Oh, I'm stupid. You had posted it right there. And I had quoted it, haha :)


    puts you into a user shell!

    ---------- Post added at 11:02 AM ---------- Previous post was at 10:49 AM ----------


    Do these two tipps help: Fixing adb_usb.ini and unlocking?
    http://askubuntu.com/questions/613333/adb-shell-on-bq-aquaris-fails-with-error-closed

    To answer your questions, Libertine uses proot as it's backend (and God am I hating it, trying to run WINE under QEMU with a modified kernel to support binfmt inside of Libertine causes WINE to crash with an illegal instruction due to proot only really emulating binfmt while in a root shell.

    As for what's mounted where, I believe they only mount /proc, /dev and a couple other system mounts while in root mode. In normal mode (libertine-launch), it mounts .local/share/libertine-container/user-data/containerid into /home and then bind mounts your XDG spec directories (Documents, Music, Pictures, Videos, etc) into that mounted home directory. To my knowledge nothing else is shared within the container.

    As for mate-terminal, it's similar to gnome-terminal except it's built using GTK2 since GTK3 apps are still an issue in Libertine. You could easily use XTerm instead. As for the keyboard, that's a great idea, I should try that with onboard to get around the system keyboard's issues until it official drops in OTA-12.

    And lastly, there doesn't seem to BE a difference except that proot simulates the user namespace, so it does apply the container's uid/gids (for instance, running apt through libertine-launch will work, but dpkg will fail without root and many system files inside the container will not have write permissions), it's also worth noting that sudo doesn't seem to work under proot at all due to how proot does its chroot implementation.

    Oh I noticed I forgot to address the stability of shells, it is true that Libertine does not seem to expect us to access the shell in this way, however it does run apt via the root shell inside the container. So it seems to be an issue running a normal shell as compared to an application.

    For those of you that use aliases, here are some good ones for you:

    Code:
    alias lcm=libertine-container-manager
    alias lcm-ip=libertine-container-manager install-package -p 
    alias lcm-rp=libertine-container-manager remove-package -p
    alias lcm-search=libertine-container-manager search-cache -s
    alias lcm-exec=libertine-container-manager exec -c
    alias lcm-add-repository=libertine-container-manager configure -a
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone