Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tips:lxd [2017/11/24 12:12] nicolatips:lxd [2019/11/19 19:12] (current) – [container] scipio
Line 5: Line 5:
  
 <code> <code>
-sudo add-apt-repository --yes ppa:ubuntu-lxc/lxd-stable +apt remove lxd lxd-client 
-sudo apt update +snap install lxd
-sudo apt install lxd+
  
 # create zfs dataset on pool rpool # create zfs dataset on pool rpool
Line 129: Line 128:
 lxc list lxc list
 </code> </code>
 +
 +create custom image from local container
 +<code>
 +lxc publish local-container --alias mycustomimage
 +</code>
 +
 +create container from previous image
 +<code>
 +lxc launch mycustomimage newcontainer
 +</code>
 +
 +
  
 bash inside bash inside
Line 162: Line 173:
 </file> </file>
  
 +
 +===== network =====
 +
 +<code>
 +lxc network create br0
 +lxc network show br0
 +lxc network edit br0
 +</code>
 +
 +static IP container
 +<code>
 +istance=c1
 +
 +lxc stop $instance
 +lxc network attach lxdbr0 $istance eth0 eth0
 +lxc config device set $istance eth0 ipv4.address 10.99.10.42
 +lxc start $istance
 +</code>
 ===== servers ===== ===== servers =====
  
Line 192: Line 221:
 <code bash> <code bash>
 NAME=x11test NAME=x11test
-lxc launch images:ubuntu/xenial/amd64 $NAME+lxc launch images:ubuntu/bionic/amd64 $NAME
 </code> </code>
  
Line 198: Line 227:
 <code bash> <code bash>
 lxc exec $NAME -- apt install xterm lxc exec $NAME -- apt install xterm
 +lxc exec $NAME bash
 +apt install mesa-utils x11-apps
 </code> </code>
  
-set DISPLAY env to xorg server on host + 
-<code bash+<code> 
-lxc config set x11test environment.DISPLAY <ip-of-host-lxdbr0-bridge>:0+NAME=nvidia-sdk-manager 
 +lxc config set $NAME environment.DISPLAY <ip-of-host-lxdbr0-bridge>:0 
 +lxc config set $NAME environment.DISPLAY :0 
 +lxc config device add $NAME X0 disk path=/tmp/.X11-unix/X0 source=/tmp/.X11-unix/X0 
 +lxc config device add $NAME Xauthority disk path=/root/.Xauthority source=${XAUTHORITY}
 </code> </code>
  
Line 294: Line 329:
 {{tag>[wiki lxd 'profile network' apache vlan]}} {{tag>[wiki lxd 'profile network' apache vlan]}}
  
-===== LXD HOST BUILDING ===== 
  
-Create VM with your Hypervisor  
- 
-Requirements: 
-  * 50 GB in LVM 
-  * 2 GB RAM 
-  * 2 core processor 
- 
- 
-<code> 
-apt update &&yes | apt upgrade && yes | apt-get install openssh-server zfsutils-linux</code> 
- 
-**Repair error maybe** 
-<code >nano /etc/mdadm/mdadm.conf </code> 
-add this line 
-<code> 
-ARRAY <ignore> devices=/dev/sda 
-</code> 
 ===== Vlan attach ===== ===== Vlan attach =====
 <code>apt-get install vlan </code> <code>apt-get install vlan </code>
Line 330: Line 347:
     netmask 255.255.255.0     netmask 255.255.255.0
     vlan-raw-device eth1 </code>     vlan-raw-device eth1 </code>
-===== LXD configuration ===== 
- 
-Install ppa and latest version 
-<code>add-apt-repository --yes ppa:ubuntu-lxc/lxd-stable && apt update && yes | apt upgrade </code> 
-<code>lxd init</code> 
- 
-all default option but no autoupdate image 
- 
-<code>apt-get install apt-cacher-ng </code> 
- 
-reboot 
  
 ===== Send file to your new host ===== ===== Send file to your new host =====
  • tips/lxd.1511521974.txt.gz
  • Last modified: 2017/11/24 12:12
  • by nicola