canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.38k stars 931 forks source link

lxd ui returns a json response instead of the gui #12069

Closed lotusorrose closed 1 year ago

lotusorrose commented 1 year ago

Required information

config: core.https_address: '[::]:8443' api_extensions:

Issue description

Tried the steps mentioned on

Steps to reproduce

  1. install lxd as snap install lxd --edge
  2. initialize it as lxd init with all defaults except for the "lxd server over network" where yes was provided
  3. try to access the ui as https://10.0.0.100:8443/ (10.0.0.100 is the IP of the box where lxd was installed)

Information to attach

output for the request to https://10.0.0.100:8443/ is

{"type":"sync","status":"Success","status_code":200,"operation":"","error_code":0,"error":"","metadata":["/1.0"]}
tomponline commented 1 year ago

Which user agent did you use?

Could be the same issue as https://github.com/canonical/lxd/issues/12038#issuecomment-1640391940

lotusorrose commented 1 year ago

both Firefox and Microsoft edge

tomponline commented 1 year ago

Please can you show how you enabled the UI?

lotusorrose commented 1 year ago

I had enabled the UI as follows

sudo snap set lxd ui.enable=true
sudo systemctl reload snap.lxd.daemon
lotusorrose commented 1 year ago

Tom, however I was able to access the ui after changed the access url to https://10.0.0.100:8443/ui/ maybe its just updating the documentation to reflect the correct url

tomponline commented 1 year ago

There should be a redirection if a user agent containing "Gecko" is used.

lotusorrose commented 1 year ago

okay so I dont know what went wrong the first few times after which I created the issue, I just ran the below commands now and it seems to redirect to /ui/ as expected.

sudo snap remove --purge lxd
sudo snap install lxd
lxd init
sudo snap set lxd ui.enable=true
sudo systemctl reload snap.lxd.daemon
gustavosr98 commented 7 months ago

I couldn't find on the documentation a reference to those commands

sudo snap set lxd ui.enable=true
sudo systemctl reload snap.lxd.daemon
tomponline commented 7 months ago

LXD 5.21 onwards has the UI enabled by default and so it was removed from the latest version of the docs.