Megatest

Changes To lxd_test_cluster
Login

Changes to "lxd_test_cluster" between 2017-03-23 19:03:54 and 2017-03-23 19:05:15

30
31
32
33
34
35
36

37

38

39

40

41

42
43
44
45
46
47
48
49
50
51
52
53




54
55
56
57
58
59
60
61
62

63

64

65
66
67

68
69
70

71

72

73

74

75
76
77
78
79

80

81
82
83
84
85

86

87

88

89
90
91
92
93
94
95

96

97

98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

























122
123
124
125
126
127
128
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57


58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
























124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155







+

+

+

+

+

+










-
-
+
+
+
+









+

+

+



+



+

+

+

+

+





+

+





+

+

+

+







+

+

+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







-   put containers on home network to make things easy

## install lxd - loosely followed [this](https://stgraber.org/2015/04/21/lxd-getting-started/)<a id="orgheadline2"></a>

## put containers on home LAN- followed [this](https://insights.ubuntu.com/2015/11/10/converting-eth0-to-br0-and-getting-all-your-lxc-or-lxd-onto-your-lan/) procedure<a id="orgheadline3"></a>

    host# mkdir /lxd-shared

    host# chown 100000:100000 /lxd-shared

    host# chmod 777 /lxd-shared

    host# xc remote add images images.linuxcontainers.org

    host# lxc launch images:ubuntu/xenial/amd64 ruby

    host# lxc launch images:ubuntu/xenial/amd64 pablo

    host# lxc launch images:ubuntu/xenial/amd64 ash

## setup shared space across containers, mounted from host fs<a id="orgheadline4"></a>

    mkdir /lxd-shared

-   my root disk is bigly

    chmod 777 /lxd-shared

    host# lxc config device add ruby sharedtmp disk path=/lxd-shared source=/lxd-shared 
    host# lxc config device add ash sharedtmp disk path=/lxd-shared source=/lxd-shared  
    host# lxc config device add ruby sharedtmp disk path=/lxd-shared source=/lxd-shared

    host# lxc config device add ash sharedtmp disk path=/lxd-shared source=/lxd-shared

    host# lxc config device add pablo sharedtmp disk path=/lxd-shared source=/lxd-shared

## Setup containers<a id="orgheadline5"></a>

-   Foreach container :

    host# lxc exec container /bin/bash

    container# apt update

    container# apt upgrade

    container# apt-get install -y openssh-server htop ncurses-term fossil make

    container# service ssh start

    container# addgroup megatest

    container# adduser --ingroup megatest mtuser

    container# apt-get install -y libreadline-dev

    container# apt-get install -y libwebkitgtk-dev libfreetype6-dev libx11-dev libxpm-dev libxmu-dev libxft-dev libgtk2.0-dev \

    container# libgl1-mesa-dev libglu1-mesa-dev libpangox-1.0-dev \

    container# bison libwebkitgtk-3.0-dev

    container# apt-get install -y libmotif-common

    container# apt-get install -y uuid-dev

## setup ssh host keys across mtuser<a id="orgheadline6"></a>

    host# lxc exec container1 /bin/bash

    container1# su - mtuser

    % ssh-keygen

-   leave password blank, take all defaults

    % cat .ssh/id\_rsa.pub > .ssh/authorized\_keys

    % chmod go= .ssh/authorized\_keys

    % tar czvf /lxd-shared/mtuser-ssh.tgz .ssh

    % ssh container2 tar xzvf /lxd-shared/mtuser-ssh.tgz

    % ssh container3 tar xzvf /lxd-shared/mtuser-ssh.tgz

-   ssh between all pairs to initialize host keys.  should be passwordless now.

## pick a container and setup X / vnc<a id="orgheadline7"></a>

    container# apt-install vnc4server xfce4

    container# su -c mtuser

    % vncpasswd

    put following in .vnc/xstartup
     #!/bin/sh
     
     # Uncomment the following two lines for normal desktop:
     # unset SESSION\_MANAGER
     # exec /etc/X11/xinit/xinitrc
     
     #[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
     #[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
     #xsetroot -solid grey
     #vncconfig -iconic &
     #x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
     #x-window-manager &
     
     
     #!/bin/sh
     unset SESSION\_MANAGER
     unset DBUS\_SESSION\_BUS\_ADDRESS
     startxfce4 &
     
     [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
     [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
     xsetroot -solid grey
     vncconfig -iconic &
-   put following in .vnc/xstartup
    
        #!/bin/sh
        
        # Uncomment the following two lines for normal desktop:
        # unset SESSION\_MANAGER
        # exec /etc/X11/xinit/xinitrc
        
        #[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
        #[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
        #xsetroot -solid grey
        #vncconfig -iconic &
        #x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
        #x-window-manager &
        
        
        #!/bin/sh
        unset SESSION\_MANAGER
        unset DBUS\_SESSION\_BUS\_ADDRESS
        startxfce4 &
        
        [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
        [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
        xsetroot -solid grey
        vncconfig -iconic &

mtuser% vncserver -geometry 1366x746 -depth 24

## fix consternating issue breaking tab completion working in any term:<a id="orgheadline8"></a>

-   edit  ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
-   find the line