Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

My code is:

$disk1 = array(
                "path" => "/var/lib/libvirt/images/MyNewVM.img",
                "driver" => "raw",
                "bus" => "ide",
                "dev" => "hdc",
                "size" => "500M"
$disks = array( $disk1 );
$network1 = array(
                'mac' => '00:11:22:33:44:55',
                'network' => 'default'
$networks = array( $network1 );

if(libvirt_domain_new($conn, $name, $arch, $memMB, $maxmemMB, $vcpus, $iso_image, $disks, $networks,$flags))
       echo "Success";
        echo "Failed - ".libvirt_get_last_error()."<br />";

Output :

Failed - Cannot get installation XML

Am new to php-libvirt. Kindly say the solution to solve it. Thanks in advance.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.