Configure Networking for LXD Virtual Machines on Ubuntu Linux | Open Source | DevOps | Software

Поділитися
Вставка
  • Опубліковано 7 вер 2024

КОМЕНТАРІ • 36

  • @TrevorSullivan
    @TrevorSullivan  Рік тому +3

    Here's a playlist dedicated to LXD! ua-cam.com/play/PLDbRgZ0OOEpX_uqK_hAq98ltdc4DP-D34.html

    • @pipi_delina
      @pipi_delina Рік тому +1

      Thanks

    • @ndevadas
      @ndevadas 6 місяців тому

      when I list lxc list I don't get a ip4 hence I cannot connect to internet from windows 11. I have ip6 address though. Do you know there reason or a work around. My lxd/lxc version is 5.20. Thank you.

    • @TrevorSullivan
      @TrevorSullivan  6 місяців тому

      @@ndevadas Are you using the default network configuration in LXD? I have seen a number of cases where virtual machines do not get IPv4 addresses. In particular, I noticed this when using LXD on a Hyper-V virtual machine. Are you running LXD under a VM, or is it on bare metal?

    • @ndevadas
      @ndevadas 6 місяців тому

      @@TrevorSullivan yes, I ran lxd init and accepted default answers. I then created an Ubuntu 22.04 container. Lxc list does not get a ipv4 private IP. Lxc network list has a range assigned correctly.

    • @ndevadas
      @ndevadas 6 місяців тому

      yes bare metal.

  • @erikzulu
    @erikzulu Рік тому +2

    Nice! informative, thank you.

  • @u07t17
    @u07t17 11 місяців тому

    Thanks Trevor! Working an internal cloud POC and will use this information. Thank you.

  • @sanjayidpuganti
    @sanjayidpuganti 5 місяців тому

    Thanks Trevor. Helped me a lot.

  • @CQ123
    @CQ123 3 місяці тому

    I really would like to see a video explaining the real benefit of using LXD instead pure-LXC. All those networking options are pretty simple to do on pure-LXC side, without pushing extra lines of code to the system. I easy use pure bash scripts to automate most of what LXD does... but.. the LXD project probably is much more - and very bad communicated to the community. My 2 cents.

  • @capcata
    @capcata 4 місяці тому

    Secondaty ip on host for bridge fwd!!!! I spent days until found your video.

  • @ewenchan1239
    @ewenchan1239 4 місяці тому

    I'm running LXD on Proxmox 7.4-17 (Debian 11) directly itself.
    Given that, Proxmox has already taken over my physical network interfaces with the network bridge.
    So...how do I connect the CTs/VMs that are managed by LXD to the network such that it would still be able to see the host? Is this a scenario where I would need to add an additional network card because I won't be able to piggy-back off of my existing network?
    Your help is greatly appreciated.
    Thank you.

  • @madhusudanbv7056
    @madhusudanbv7056 4 місяці тому

    Hi Trevor - Great tutorial! Thanks. I have a question. Why can't we just add a route to the bridged network from our physical host?. I tried this and it works.

    • @TrevorSullivan
      @TrevorSullivan  4 місяці тому

      That's a great idea! Sometimes the simplest solution is the best! 😊 Thanks for joining my channel! I'm glad this has been helpful for you.

    • @TrevorSullivan
      @TrevorSullivan  4 місяці тому

      Keep in mind that you'll have to add a route for any other systems, to route through the physical host, in order to access the VM. The way you did it, will only allow the physical host to access the VM. You could probably add the route at your router, and make sure you enable routing in the host's kernel also.

    • @madhusudanbv7056
      @madhusudanbv7056 4 місяці тому +1

      @@TrevorSullivan : Thank you. Yes. As I am connected to a Wi-Fi network currently and the router's static route doesn't pass through. I will implement this once am in wired network :) I am not sure if the routes can be passed using wifi network.

    • @TrevorSullivan
      @TrevorSullivan  4 місяці тому

      @@madhusudanbv7056 if you add a route to your Internet router, it will apply to your client device regardless of if it's Wi-Fi or wired.

  • @henryschroer3813
    @henryschroer3813 8 місяців тому

    how can a LXC VM or container talk to another container on the same LXD cluster?

    • @TrevorSullivan
      @TrevorSullivan  8 місяців тому

      I have another video that talks about clustering with LXD

  • @adahaj
    @adahaj 11 місяців тому

    How can I access the VM created using LXD via SSH ?

    • @TrevorSullivan
      @TrevorSullivan  10 місяців тому +1

      You'll have to set up SSH authentication inside the VM. This guide doesn't cover that specific topic, but I'm sure there are hundreds, if not thousands, of guides on setting up SSH authentication! You might have to install the "openssh-server" package with "apt-get" as well.

  • @bitferret-rx5rn
    @bitferret-rx5rn 7 місяців тому

    Hello @trevor... by chance have you gotten this error before... I am trying to create a centos7 container on an LXD host that is running ubuntu 22.04.
    Error: Failed instance creation: Failed getting remote image info: Failed getting image: The requested image couldn't be found

    • @TrevorSullivan
      @TrevorSullivan  7 місяців тому

      Hey there, you can't use Docker Hub images to launch LXC containers. Check the Linux containers server to see which images are available.

    • @bitferret-rx5rn
      @bitferret-rx5rn 7 місяців тому

      @@TrevorSullivan this is the command... I am sure its a lxd command.. "lxc launch images:centos/7/amd64 cenots-db"

    • @TrevorSullivan
      @TrevorSullivan  7 місяців тому

      @@bitferret-rx5rn That command worked fine for me, except I got a new error saying "Error: The image used by this instance requires a CGroupV1 host system" .. I am not sure what that means.

    • @bitferret-rx5rn
      @bitferret-rx5rn 7 місяців тому

      @@TrevorSullivan before I placed the firewall rule to allow traffic in and out, it worked only I could not get ip... After the change I got the error

    • @TrevorSullivan
      @TrevorSullivan  7 місяців тому

      @@bitferret-rx5rn well it sounds like you've identified the root cause of your issue 😊 I'm sorry, I can't help with your firewall configuration most likely. I'd recommend looking at any proxy settings that could interfere with requests to the image retrieval service.

  • @barma1309
    @barma1309 10 місяців тому

    Can you show command for add nic to profile bridge ?

    • @barma1309
      @barma1309 10 місяців тому

      i try to use "lxc profile device add bridge enp0s8 nic" and i got
      Error: Device validation failed for "enp0s8": Failed loading device "enp0s8": Unsupported device type

    • @barma1309
      @barma1309 10 місяців тому

      it seems right to use that "lxc profile device add bridge enp0s8 nic nictype=bridged parent=br0 name=eth0"

    • @TrevorSullivan
      @TrevorSullivan  4 місяці тому

      Sorry for the delay in responding. I always refer to this tutorial for the commands I need to use to set up the bridge adapter. blog.simos.info/how-to-make-your-lxd-containers-get-ip-addresses-from-your-lan-using-a-bridge/

  • @oldsmar_chaos
    @oldsmar_chaos 10 місяців тому +1

    trevor skipped the last two parts and they are needed for his other videos.. he deleted my comment. why.. trevor.. i believed in you