Giter Club home page Giter Club logo

lxd-dashboard's Introduction

lxd-dashboard

This open source LXD dashboard is developed by LXDWARE and provides a web-based user interface capable of managing multiple LXD servers from a single location. Some of the features include:

  • Connect and manage multiple LXD servers
  • Create LXD container and virtual machine instances from either a form or JSON input
  • Start, stop, rename, and delete LXD instances
  • Copy instances to create new instances
  • Create, restore and delete snapshots of instances
  • Create instances from snaphots
  • Migrate instances between hosts on an LXD cluster
  • Download LXD container and virtual machine images to LXD hosts
  • Create, edit, apply, and remove LXD profiles
  • Create, edit, and delete networks, storage pools, storage volumes, and projects
  • Switch between projects on an LXD host
  • Interact with instances using web-based terminal
  • Create and download backups of LXD instance to your local computer
  • Create local users and groups
  • Apply role based access control

The LXD dashboard can be deployed on either an LXC or Docker container. The software is built primarily using Ubuntu, NGINX, and PHP.

Installation instructions can be found on the LXDWARE web site located at https://lxdware.com/installation

lxd-dashboard's People

Contributors

danieldean avatar fthorns avatar kay0u avatar matthewalanpenning avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lxd-dashboard's Issues

.

.

Instance Type - custom

Hi, is there anyway to create a custom instance type please? Rather than having to select form the predefined instance types, is there anyway to specify manually what CPU, RAM, HDD when creating a new instance please?

Feature requests

Hi, this is a the best LXD gui management I have seen.
Would be fantastic to see some of the below features implemented if possible please.

  • Pcie / GPU Passthrough
  • USB Stick passthrough
  • Terminal view / Graphical console (linux and windows)

CPU usage?

Hi, I love this project, and I am wondering if we can add a CPU usage % in dashboard?

trouble getting setup

i used the install instructions on the site for v3.0.0 but i cant connect to a forwarded port:

apt update && apt install nginx php-fpm php-curl sqlite3 php-sqlite3 -y
wget https://github.com/lxdware/lxd-dashboard/archive/v3.0.0.tar.gz
tar -xzf v3.0.0.tar.gz
cp -a lxd-dashboard-3.0.0/default /etc/nginx/sites-available/
cp -a lxd-dashboard-3.0.0/lxd-dashboard /var/www/html/
mkdir -p /var/lxdware/data/sqlite
mkdir -p /var/lxdware/data/lxd
mkdir -p /var/lxdware/backups
chown -R www-data:www-data /var/lxdware/
chown -R www-data:www-data /var/html
chown -R www-data:www-data /var/www/html/
systemctl restart nginx
exit

$ lxc config device add lxd-dashboard lxd-dashboardHttps proxy listen=tcp:0.0.0.0:9112 connect=tcp:127.0.0.1:8080

$ lxc config show lxd-dashboard -e
...
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
lxd-dashboardHttps:
connect: tcp:127.0.0.1:8080
listen: tcp:0.0.0.0:9112
type: proxy

when i go to host-ip:9112 i get: "connection reset".

Feature request: Scheduled backup

Hi Matthew,

Just wondering if you have considered adding scheduled backup and retention feature. I tried LXDware before but dropped it over https://www.nuber.io/ due to that feature. But I would really like to use LXDware for future project.

Thanks,
Abhinav

Attaching/Detaching Volume to Instance

Please add a feature to attach/detach a volume to instance. We already have a feature to create a volume from storage pool but attaching/detaching created volume to instance is missing which is there in LXD-MOSAIC.

nginx needs to be configured for php8.1 with version 3.7.0

Hello. I got LXD-Dashboard installed in a Proxmox LXC container, and now have access to the GUI. Looking forward to start testing.

I just wanted to note that following the installation to a LXC container guide, nginx comes with php7.4 enabled by default, this results in a 502 Bad Gateway when accessing the GUI.

It's fixed easily by editing /etc/nginx/sites-enabled/default

#fastcgi_pass unix:/run/php/php7.4-fpm.sock;
   fastcgi_pass unix:/run/php/php8.1-fpm.sock;

For anyone looking to install in Proxmox, here's a quick guide:

  1. Set up a ubuntu 22.10 container, and enable options: nesting=1,fuse=1

  2. quick setup. Yes, snap install core must be done twice, the first time will result in error, second time will work.

apt update && apt upgrade
dpkg-reconfigure tzdata
do-release-upgrade
apt install snapd
snap install core
snap install core
snap refresh core
snap install hello-world
hello-world

snap install lxd
apt install nginx php-fpm php-curl sqlite3 php-sqlite3 -y 
wget https://github.com/lxdware/lxd-dashboard/archive/refs/tags/v3.7.0.tar.gz
tar -xzf v3.7.0.tar.gz

cp -a lxd-dashboard-3.7.0/default /etc/nginx/sites-available/ && \
cp -a lxd-dashboard-3.7.0/lxd-dashboard /var/www/html/

mkdir -p /var/lxdware/data/sqlite && \
mkdir -p /var/lxdware/data/lxd && \
mkdir -p /var/lxdware/backups

chown -R www-data:www-data /var/lxdware/ && \
chown -R www-data:www-data /var/www/html

nano /etc/nginx/sites-enabled/default 

    #fastcgi_pass unix:/run/php/php7.4-fpm.sock;
    fastcgi_pass unix:/run/php/php8.1-fpm.sock;
    
systemctl restart nginx

Thanks for great app!

Network ACL rules

Unable to create Network ACL rules using Web UI. Had to write a json file for that. But not able to get any sample json for the same.

Need clarification on "remotes" and available images

Hello. First of all thanks for great project.
I have few issues.

  1. It looks like content of "Simplestreams" menu is not in sync with "lxc remote list". If I'm adding new simplestream via UI - it's not displayed by command "lxc remote list" and vise versa. Is this as designed?

  2. I have added new remote repository both in UI (via Simplestreams menu) and using console command: lxc remote add --protocol simplestreams ubuntu-minimal https://cloud-images.ubuntu.com/minimal/releases/
    But I did not find a way to search for available remote image in lxd-dashboard UI. Here I see a list of predefined images and nothing else. изображение
    Is there any way to search for remote image via UI?

could not find driver

I'm attempting an installation on Ubuntu 22.04 for lxd-dashboard 3.7.0

when I attempt to set up the first user, I am presented with the below error and I am not able to proceed

could not find driver

any help would be greatly appreciated

Not adding existing containers to the lxd-dashboard

Hi

I set up the lxd-dashboard and connected it to some of our lxd servers. It connects successfully but is not able to pick up existing containers.

It keeps on showing: "Executing su command on 'container'.

Can you please assist me with getting this sorted?
LXD version = 3.0.3

Regards
Eddy

Container List displays 'Root Disk' of 0 MB for all containers

Running lxd-dashboard v3.10.

I have multiple hosts running LXD. On some hosts(paikea), the root disk displays the space each container has for persistent storage. On others (koa) it does not. See attached screen shots.

Additional host LXD version information,

  • paikea v4.21
  • koa v4.20

paikea_container_list
koa_container_list

unable to add host

Hi.
I have been install lxd cluster in private network .
I forwarded 8443 on public IP to lxd host IP address on port 8443.
when I load https://public_ip:8443 on browser I see:
{"type":"sync","status":"Success","status_code":200,"operation":"","error_code":0,"error":"","metadata":["/1.0"]}
but I can't add host to dashboard . (Unable to connect to remote host)
how I can find the problem?
lxd-dashboard installed as a container in lxd cluster and use from internal ovn network.
I forwarded another public IP address to the lxd-dashboard container to access it directly from browser.
Regards.

Undefined array key "source"

Привет!
Не хватает проверки "source".
Если создать lvm через lxd init тогда пропадет "source" что приведет к Undefined array key из-за чего сломается json ответ и в итоге не отрисуется список storage-pools.
Для фикса надо сделать предварительную проверку key в array.

echo '"' . htmlentities($storage_pool['config']['source']) . '",';

 if (!empty($device_array['config']['source'])){
              echo '"' . htmlentities($storage_pool['config']['source']) . '",';
            } else {
              echo '"---",';
            }

Close websockets on exit from exec

Hi,

I have been using your project for a while and been through a few upgrades all of which have gone smoothly. There is a modification I apply each time I update which closes the websockets when the exit command is given in a terminal. Without this the websockets remain open and I need to remember to click Stop Exec.

I know you have a beforeunload event that should prevent websockets from getting left open but I have occasionally found this has not worked and ends up requiring a restart of LXD or the server to end the operation. I think this issue mostly occurs with mobile use but I think it may have happened a few times on desktop too.

I would have thought this issue is only applicable to exec as exit on a console should instead return to login.

Would you be able to incorporate this or accept it as a pull request?

danieldean@dfffdb7

So far as I can tell no other issues arrise from including this (I have been using/testing it for a couple of years).

Thanks

Daniel

.

Delete please

Assign User To Project

Please add a feature where we can enable multi tenancy by assigning users to project. The user assigned to particular project must be able to access resources within his scope of his project. Also enable to setup particular amount of Quota(resources) to a project, So that user shouldn't exceed his limit.

how-to delete containers?

My bad if this is already in the Docs, but I don't see a way to delete a container (using v3.10). How is this done?

PHP 8.1

Is the codebase ready for PHP 8.1 in Ubuntu 22.04?

Configuration directory

Currently, lxd-dashboard uses a hard coded directory for it's configuration and this prevents me from running more than one instance on the same machine. Could you make this value to be overridable somehow?
Thanks.

function session_start is missing

Installed release 3.1.0 in an Alpine 3.15 container.

I have things running for accessing the first page (I assume a login), however HTML screen is just a welcome page (with dimmed outline).

I note the following in the nginx /var/log/nginx/error.log

  thrown in /var/www/localhost/htdocs/lxd-dashboard/backend/config/db.php on line 22" while reading response header from upstream, client: 2607:c000:8011:fd00::32, server: _, request: "GET /backend/config/login.php?action=loadLoginForm HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "[2607:c000:8011:fd00:216:3eff:fe84:8e3e]", referrer: "http://[2607:c000:8011:fd00:216:3eff:fe84:8e3e]/"
2022/01/03 00:07:05 [error] 748#748: *12 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function session_start() in /var/www/localhost/htdocs/lxd-dashboard/backend/aaa/authentication.php:22
Stack trace:
#0 {main}
  thrown in /var/www/localhost/htdocs/lxd-dashboard/backend/aaa/authentication.php on line 22" while reading response header from upstream, client: 2607:c000:8011:fd00::32, server: _, request: "GET /backend/aaa/authentication.php?action=validateAuthentication HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "[2607:c000:8011:fd00:216:3eff:fe84:8e3e]", referrer: "http://[2607:c000:8011:fd00:216:3eff:fe84:8e3e]/"
2022/01/03 00:07:05 [error] 748#748: *15 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function session_start() in /var/www/localhost/htdocs/lxd-dashboard/backend/config/db.php:22
Stack trace:
#0 /var/www/localhost/htdocs/lxd-dashboard/backend/config/login.php(31): require_once()
#1 {main}
  thrown in /var/www/localhost/htdocs/lxd-dashboard/backend/config/db.php on line 22" while reading response header from upstream, client: 2607:c000:8011:fd00::32, server: _, request: "GET /backend/config/login.php?action=loadLoginForm HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "[2607:c000:8011:fd00:216:3eff:fe84:8e3e]", referrer: "http://[2607:c000:8011:fd00:216:3eff:fe84:8e3e]/"

Went looking for the function definition in lxd-dashboard/, I see many calls to the function, but no function definition. Perhaps this function is defined elsewhere?

Console and Exec not proxied via dashboard

When trying to execute "Console" or "Exec" to a VM or container the request is sent towards a node instead of being proxied via lxd-dashboard.

Although this issue is not of technical nature it causes a potential security risk if audited, since "end user" requires connection to LXD API and therefore defeating RBAC if "end user" has malicious intentions and additional know how.

Issue examined in version 3.6. Previous versions were not tested

GUI Support for Network ACL

Can we have a form type of Network ACL creation and defining it too rather than setting Network ACL's by typing JSON.

Update Notifier (Footer)

Hi Matthew,

Could we please have an update notifier built into the dashboard (similar to pi-hole)?

Many thanks.

Kind Regards,
Radu

Interactive terminal access

Hi,

I have tried most of the web-based interfaces to LXD and of all of those I think yours provides the best balance of features vs resource requirements for me. I am running LXD on an RPi 4 8GB and lxd-dashboard is running as a container which I can access thanks to a reverse proxy on the host. So thanks, it is an excellent project.

To setup and get new containers running and doing something useful my one request would be for interactive terminal access. I realise moving from a non-interactive to interactive terminal probably is not trivial. LxdMosaic does include this so perhaps some inspiration could be taken from there?

I am happy to assist where I can but I do not know PHP and my JS is rather limited. If this is beyond the scope of the project or would add signifcant resource requirements please feel free to close.

Thanks

Daniel

Central base.php or config.php

The repeating code at start of every php file replace through:
require_once('../admin/base.php');
base.php:
$cert = "/var/lxdware/data/lxd/client.crt";
$key = "/var/lxdware/data/lxd/client.key";

//Instantiate the GET variables
if (isset($_GET['remote']))
$remote = filter_var(urldecode($_GET['remote']), FILTER_SANITIZE_STRING);
if (isset($_GET['project']))
$project = filter_var(urldecode($_GET['project']), FILTER_SANITIZE_STRING);
if (isset($_GET['instance']))
$instance = filter_var(urldecode($_GET['instance']), FILTER_SANITIZE_STRING);

//Determine host info from database
$db = new SQLite3('/var/lxdware/data/sqlite/lxdware.sqlite');
$db_statement = $db->prepare('SELECT * FROM lxd_hosts WHERE id = :id LIMIT 1;');
$db_statement->bindValue(':id', $remote);
$db_results = $db_statement->execute();
return $db_results
...
or wrap the above as function. can add another repeating tasks as function in base.php as well.

Indeed dont need to put everything inside
if (!empty($_SERVER['PHP_AUTH_USER'])) {
Can have that in base and if not matched, just redirect to login or ../index.html

Start/Stop Container results in error: Unable to connect to remote host. HTTP status code: 400

Running lxdware v3.4 on Alpine v3.15

Noted this error after starting or stopping a container
"Unable to connect to remote host. HTTP status code: 400"

Work-around: log out of lxdware, and log back in.

The FIX is to increase the number of php-fpm7 children processes. Error log reports:

/var/log/php7 # tail error.log 

[18-Apr-2022 17:30:05] NOTICE: fpm is running, pid 678
[18-Apr-2022 17:30:05] NOTICE: ready to handle connections
[18-Apr-2022 17:41:29] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[18-Apr-2022 17:41:48] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[18-Apr-2022 17:43:39] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it

Editing the /etc/php7/php-fpm.conf file and setting a value:

process.max = 16

restart php-fpm7 daemon. Clears the problem. Now it is possible to start/stop containers from lxdware.

Please add this to the LXDWare on Alpine document
https://lxdware.com/lxd-dashboard-installing-from-source-in-alpine-linux/

Console and Exec commands are not redirected to the correct host in a cluster

When hosts are in a cluster, you can see all the containers from any of the hosts (which is good), but Exec and Console only work if you are on the container's actual host first.

Ex: If you select Host#1 in LXD Dashboard, then try to Console/Exec on a container running in the same cluster on Host#2, this message results:

--- Encrypted Connection Closed ---

Expected behavior: LXD dashboard should direct the Console/Exec operation to the host actually running the container, irrespective of the host currently in-focus in LXD Dashboard. (This is what the lxc command does)

Thank you - LXD Dashboard is excellent, I use it all the time.

Scheduled Backup / Snapshot

Hello, congratulations for the very nice project!

One thing which just came to my mind, is having maybe a separate tab where you could configure a scheduled Snapshot/Backup.

What do you think?

Feature Request: Delete <object> ask for confirmation

Using v3.10. While troubleshooting why the host overview data wasn't being displayed. I deleted the host by clicking on the 'trash' icon. It disappeared immediately!

I expected some form of "are you sure you want to delete this host?" confirmation. A confirmation dialog would prevent accidental deletions.

Instance downloadBackup

First of all, this is by far the most comprehensive LXD Management out there! Thanks for great work!

v. 1.2.5
instances.php
case "downloadBackup":
mkdir('../../downloads');
Files are pulled and written to ../../downloads.
When several users containers (especially some large containers) are pulled and stacked up there, it continues growing in webserver storage space.

Possible solutions could be:

  1. Clean up ../../download/* occasionally

  2. Pull the files by curl --output /tmp/".$name.".tar.gz
    This way they got a chance to disappear at some time, yet it uses server RAM.
    To avoid conflicts, output name could be: "$project.'_'.$name.'.tar.gz'
    or $file=time().'.gz' and download:
    header("Content-Disposition: attachment; $name";
    readfile(/tmp/$file_timestamp);

  3. I tried to download directly from api response, but it failed at some point due to large file (perhaps a filesize determining have had helped!

     $url = $url . "/1.0/instances/" . $inst_name . "/backups/" . $backup_name . "/export?project=" . $project;
     $results = shell_exec("sudo curl -k -L  --cert $cert --key $key -X GET '$url'"); // no --output
    

header("Content-Transfer-Encoding: chunked");
header("Content-Description: File Transfer");
header("Content-Type: application/octet-stream");
header("Cache-Control: no-cache, must-revalidate");
header("Expires: 0");
header("Content-Disposition: attachment; filename=$file_name");
//header("Content-Length: $filesize");
header("Pragma: public");
print $results;

Use POST instead of GET when creating or updating resources

Right now, almost all forms issue GET requests. This leads to long URLs and may contain confidential data, i.e. when creating a new container. In generally, it might be considerable to use POST instead of GET for all requests, that create or change resources.

How to accept LXD server's self-signed certificate on a VPS with out browser?

I Installed lxd-dashboard from source in ubuntu 20.04 on my VPS.
I can creat container with lxd-dashboard. The container works fine, but "Console" and "Exec" page is not availiable. I got the warning

WebSocket Connection Error

There was an error connecting to your LXD server.
The LXD server may be using a self-signed certificate.
Visit https://127.0.0.1:8443/ to accept the certificate if not yet trusted.

image

How to trust the self-signed certificate on my VPS without desktop?

Assign User To Project #2

Hey :)
I am really amazed by your work in this panel. Tough I've read the old issue I couldn't get it to work, that one user just gets access to one project with limited resources. Could you help me? Thanks in advance!

[contact] Seek contact with Matthew

I'm trying to connect with Mathew Penning @matthewalanpenning (owner of the repo). I've tried to get in contact with him/you for some time to no avail.

I hope you are all well if you read this and please connect with me if you see this message.

/E

Docker Upgrade Procedure

New user here, this is by far the best LXC manager GUI out there. Thank you Matthew!

How do I upgrade a docker install (from previous version to current)?

Invalid config: Unknown configuration key: limits.cpu.allowance

I am running latest LXD-Dashboard, and LXD 4.18. I have a VM, but when I try and update the CPU I get this error:

Invalid config: Unknown configuration key: limits.cpu.allowance

Same with Ram update, I get:

Invalid config: Unknown configuration key: limits.memory.enforce

Feature request: support for raw.qemu.conf

There already is support for raw.qemu, which allows you to override and/or add to the qemu invocation command-line, but sometimes you need to override and/or add to the devices in the configuration-file that is supplied to qemu as well; FreeBSD 13.1 (and newer?) hog the CPU, unless you prevent qemu from passing a virtio-rng device to the VM, for example, and that can only be done via raw.qemu.conf

Reference: https://linuxcontainers.org/lxd/docs/master/howto/instance_qemu_config/

Unable to add Host

Hello, yesterday I installed the lxd-dashboard locally on my server. Everything went fine. Version is 3.1.0.
The lxd-dashboard and the lxd service are on the same server. After the installation I imported the key on my console and tried to add the host. I tried it with the IP and with localhost/127.0.0.1.
After hitting "Submit", I do not get an error, but the host does not occur in the host list. Where can I troubleshoot this issue? Are there some log files I can search?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.