- Notifications
You must be signed in to change notification settings - Fork15
A simple web interface based on libVirt and PHP.
License
Jiab77/libvirt-web
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A simple web interface based onlibVirt andPHP.
This project is still aWork In Progress, it might not work correctly on your side.
Please, create an issue in this case so I can track and fix it.
Thank you.
If you were looking for anodejs
version:https://github.com/Jiab77/libvirt-web-nodejs.
The installation process is pretty simple and will require only few dependencies.
The web interface should be able to run on any desktops and servers.
There is only few dependencies required:
libvirt-bin
(Thevirsh
command should be provided bylibVirt)virt-viewer
virt-install
libguestfs
php-cli
php-gd
php-xml
php-json
I have dropped the ImageMagick
convert
command from dependencies.
The project has been tested onPop_OS!, a Linux distribution based onUbuntu 18.04 LTS.
It is also tested on FreeBSD by my friend@Sevendogs5.
You should only need to install these packages:
# For desktopsudo apt install libvirt-bin virt-viewer virtinst libguestfs-tools php-cli php-gd php-xml php-json# For serversudo apt install libvirt-bin virtinst libguestfs-tools php-cli php-gd php-xml php-json# Restartsudo reboot# Check services statussystemctl status libvirt-bin.service libvirt-guests.service libvirtd.service -l
I still need to validate the packages list so this might change later.
Instruction will be provided soon.
You can run the web interface by using the embedded web server fromPHP
or usingapache
ornginx
.
You can start the server that way:
cd libvirt-web./start-local-server.sh
If you want to run the server on another interface / port, you can also do the following:
# Set another listen interface (it will catch the first IP address in this case)LISTEN_INTERFACE=`hostname -I| awk'{ print $1 }'` ./start-web-server.sh# Set another listen interface (it will catch the FQDN in this case)LISTEN_INTERFACE=`hostname -f` ./start-web-server.sh# Set another list portLISTEN_PORT=8888 ./start-web-server.sh# Set another listen interface and portLISTEN_INTERFACE=`hostname -f` LISTEN_PORT=8888 ./start-web-server.sh
sudo
is not required to run the server. It is required only if you want to run the server on a port below1024.
Then navigate tohttp://localhost:8000 with your internet browser.
This setup is not tested yet and will be documented later.
I've changed completely the project structure and now the code is splitted into several files instead of keeping everything into a single file.
The more I was adding features and cleaner logic, the more it became difficult to maintain and keep it readable and understandable.
So the best solution that came to me was split the single file into several ones, now it's much more easier to maintain the project.
A single file version still exist if you look at the filelibvirtweb.aio.php
but it will not be supported anymore.
Here will be listed missing features / those not working correctly.
- Remote connection on VM's using
virt-viewer
.- Works on local only...
- Connection to remote hypervisor.
- Not implemented yet / not correctly...
- ISO image upload.
- The upload is working but the uploaded file can't be moved to
/var/lib/libvirt/images
... - This is due to access restricted to
sudoers
with filesystem permissions.
- The upload is working but the uploaded file can't be moved to
- Graphics are still missing.
I'm using Chromium but it should work on any other modern browser.
Thanks to the respective developers for their amazing work.
Huge thanks toIngmar Decker for thePPM
Image ReaderPHP
class.
Also thanks to my friend@Sevendogs5 for supporting the FreeBSD platform.
Feel free to contribute by creating pull requests or new issues.
You can reach me on Twitter by using@jiab77.