Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A simple web interface based on libVirt and PHP.

License

NotificationsYou must be signed in to change notification settings

Jiab77/libvirt-web

Repository files navigation

A simple web interface based onlibVirt andPHP.

This project is still aWork In Progress; it may not work correctly on your host.

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.

Preview

imageimage

Installation

The installation process is pretty simple and will require only few dependencies.

The web interface should be able to run on almost any desktop or server.

Compatibility

The code should be compatible with the latest PHP version.

Feel free to create a new issue in case you find something that is not working anymore after having updated your PHP version.

Dependencies

There is only a few dependencies required:*

  1. libvirt-bin (Thevirsh command should be provided bylibVirt)
  2. virt-viewer
  3. virt-install
  4. libguestfs
  5. php-cli
  6. php-gd
  7. php-xml
  8. php-json

I have dropped the ImageMagickconvert command from dependencies.

* The name of the required packages might be different between Ubuntu and Arch Linux based distribs.

Plaforms

The project has been tested on:

And should be compatible with any Ubuntu or Arch Linux based distributions.

It has also been tested on FreeBSD by my friend@Sevendogs5.

Ubuntu and derivated distribs

You should only need to install these packages:

# For desktopsudo apt install libvirt-bin virt-install virt-viewer virtinst libguestfs-tools php-cli php-gd php-xml php-json# For serversudo apt install libvirt-bin virt-install 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.

Arch Linux and derivated distribs

You should only need to install these packages:

# For desktopparu -S libvirt virt-install virt-viewer guestfs-tools php php-gd# For serverparu -S libvirt virt-install guestfs-tools php php-gd# Enable 'php-gd' extensionsudo sed -e's/;extension=gd/extension=gd/' -i /etc/php/php.ini# Restartsudo reboot# Check services statussystemctl status libvirtd.service libvirt-guests.service -l

You can replaceparu bysudo pacman if you don't haveparu installed.

FreeBSD

Instructions are still missing at the moment.

Run the web interface

You can run the web interface by using the embedded web server fromPHP or usingapache ornginx.

PHP Embedded Web Server

You can start the server that way:

cd libvirt-web./start-web-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

sudomight be required to run the server if you want to run the server on a port below1024and/or to access VMs created under theroot user.

In this case, you might have to do the following:

cd libvirt-web ; sudo ./start-web-server.sh

Or:

cd libvirt-web ; sudo LISTEN_PORT=8888 ./start-web-server.sh

If you need to set a different listen port or interface.

Then navigate tohttp://localhost:8000 (or any other address you would have defined) with your internet browser.

Apache / nginx

This setup is not tested yet and will be documented later.

You may have to make a symlink namedindex.php that points to thelibvirtweb.php file.

Breaking Changes

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.

Missing / Not Working

Here will be listed missing features / those not working correctly.

  • Dark mode 😅
  • Remote connection on VMs usingvirt-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... (missing super user privileges)
    • This is due to access restricted tosudoers with filesystem permissions.
  • Graphic charts are still missing

Supported Browsers

I'm using Chromium but it should work on any other modern browser.

Thanks

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.

Contributions

Feel free to contribute by creating pull requests or new issues.

Author

  • Jiab77

About

A simple web interface based on libVirt and PHP.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp