![]() # Set the remote LXD server to be the defaultlxc remote switch LXD_NAME# Check the configlxc remote listįinally, let’s create a new container from WSL directly to the remote LXD server: # Create new containerlxc launch ubuntu:18.04 first-remote# Check if the container has been created with the local and remote commandlxc listlxc list LXD_NAME:Īs shown in the screenshot, the first lxc list does not show any IP, this is because the container was still being created. We will add the remote LXD server and also will set it as default, so every “local” command will actually be run on the remote server: # Add the remote LXD server -> This will request the password we set on the serverlxc remote add LXD_NAME `hvc.exe ip -4 VM_NAME | tr -d '\r'` My (current) distro for dev is ClearLinux, and as it’s not listed, here is the way to install LXC: # Search which bundle contains LXDsudo swupd search LXD# Install the recommended bundlesudo swupd bundle-add linux-lts-dev Install LXC on WSLĭue to the different distros available, please find the correct install method from this blog Our server is now fully configured, time to configure our WSL client. # Set a password for authenticating the remote clientslxc config set ust_password something-secure Now we can create our first container: # Create the containerlxc launch ubuntu:18.04 first# Confirm that the container is createdlxc listĮnable remote connection for LXD on serverīased on Stéphane’s blog, in order to enable the remote connection to LXD, we need to run the following 2 commands: # Set the port which LXD will listen tolxc config set core.https_address :8443 Once LXD installed, the storage for the containers needs to be configured: # Keep all the defaults or change only the storage pool namelxd init We will start by installing LXD on the Ubuntu VM: # Connect to the VM (I will do it without the alias)hvc.exe ssh VM_NAME# Install LXDsudo apt install lxd lxd-client Now that the connectivity is in place, we can install all the components. In order to avoid entering the SSH password on each connection, we can copy the SSH key: ssh-copy-id `hvc.exe ip -4 devlxvm | tr -d '\r'`īonus: the command hvc.exe ssh will also be impacted. Connect directly to the VM using SSH: hvc.exe ssh VM_NAMEįor this particular blog, the solution 2 will be the best and to make it easier, here is an alias that can be used: alias sshvm="hvc.exe ssh".The hvc.exe command actually ends with a cariage return character which will cause an error if we would connect with ssh `hvc.exe ip -4 VM_NAME`. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |