Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
Further testings
Browse files Browse the repository at this point in the history
  • Loading branch information
marbetschar committed May 27, 2020
1 parent 082a140 commit 9f1e079
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ In case you want to learn more about LXD, there is a pretty good documentation o
Tins will be available in elementary AppCenter soon!

**PLEASE NOTE:** Until [issue #7](https://github.com/marbetschar/tins/issues/7) is fixed, Tins expects LXD to be initialized on the host system.
To do so, please execute the following command in your terminal:
To do so, please execute the following commands in your terminal:

```
# use default values everywhere:
lxd init
# allow lxd to remap your user id into a container:
echo "root:$UID:1" | sudo tee -a /etc/subuid /etc/subgid
```

## Building
Expand Down
9 changes: 8 additions & 1 deletion data/lxd/cloud-configs/tins-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
groups:
- sudo
- wheel
- $USER
- lxd
users:
- name: $USER
groups: [sudo,wheel]
primary_group: $USER
groups: [sudo,wheel,lxd]
sudo: ALL=(ALL) NOPASSWD:ALL
- name: lxd
primary_group: lxd
inactive: true
system: true
packages:
- sudo
runcmd:
Expand Down
9 changes: 4 additions & 5 deletions data/lxd/profiles/tins-x11.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@
"name": "tins-x11",
"description": "Desktop Support",
"config": {
"raw.idmap": "both $UID $UID",
"environment.DISPLAY": ":0",
"environment.XSOCKET": "/tmp/.X11-unix/X0",
"environment.XDG_RUNTIME_DIR": "/run/user/$UID",
"environment.PULSE_SERVER": "unix:/home/$USER/pulse-native",
"user.user-data": "resource:///com/github/marbetschar/tins/lxd/cloud-configs/tins-x11.yml"
},
"devices": {
"graphics": {
"type": "gpu"
},
"PASocket": {
"path": "/tmp/.pulse-native",
"source": "/run/user/$UID/pulse/native",
"type": "disk"
},
"graphics": {
"type": "gpu"
}
}
}
13 changes: 7 additions & 6 deletions src/Widgets/ContainerListBox.vala
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ public class Tins.Widgets.ContainerListBox : Gtk.ListBox {
}

} catch (Error e) {
critical (e.message);

var error_dialog = new Granite.MessageDialog.with_image_from_icon_name (
_("Error"),
_(e.message),
Expand All @@ -138,6 +140,8 @@ public class Tins.Widgets.ContainerListBox : Gtk.ListBox {
open_instance.end (res);

} catch (Error e) {
critical (e.message);

var error_dialog = new Granite.MessageDialog.with_image_from_icon_name (
_("Error"),
_(e.message),
Expand Down Expand Up @@ -200,11 +204,6 @@ public class Tins.Widgets.ContainerListBox : Gtk.ListBox {
work_dir.make_directory_with_parents ();
}

var work_share_dir = File.new_for_path (work_dir.get_path () + "/share");
if (!work_share_dir.query_exists ()) {
work_share_dir.make_directory_with_parents ();
}

var compositor_config_file = File.new_for_path (work_dir_path + "/weston.ini");
string[] compositor_config = {
"[core]",
Expand Down Expand Up @@ -257,6 +256,7 @@ public class Tins.Widgets.ContainerListBox : Gtk.ListBox {
"-extension", "XTEST", "-tst",
"-dpms",
"-s", "off",
"-auth", work_dir.get_path () + "/Xauthority.server",
"-nolisten", "tcp",
"-dpi", "96"
};
Expand Down Expand Up @@ -296,7 +296,6 @@ public class Tins.Widgets.ContainerListBox : Gtk.ListBox {
// }
// });


var stop_operation = Application.lxd_client.stop_instance (instance.name);
try {
Application.lxd_client.wait_operation (stop_operation.id);
Expand All @@ -318,6 +317,8 @@ public class Tins.Widgets.ContainerListBox : Gtk.ListBox {
warning (e.message);
}



// make sure we don't open any terminal if we get here
// so jump out of the function
return;
Expand Down

0 comments on commit 9f1e079

Please sign in to comment.