1

I am having a HECK of a time getting virtual machines running on 18.04 (server) LTS. I say running, because it FEELS like virsh REPORTS it running, but that it never starts up. This is a very basic test VM I am trying to set up so that I can get the syntax correct for my couple production (home server) VMs I am trying to get stood up. I want to quit and move back to 14.04 LTS like I did years ago, but I am trying to learn WHY I am seeing what I am.

This is a FRESH install of Ubuntu server 18.04 LTS, and only the following has been done thus far.

add to /etc/apt/sources.list, this prevents the packages from not being found and installed by OS, specifically mailutils & ubuntu-vm-builder.

deb http://archive.ubuntu.com/ubuntu/ bionic universe
deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe

sudo apt-get install zfsutils-linux
sudo zpool import Storage
sudo zpool status
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install htop nmon samba nfs-kernel-server nfs-common qemu-kvm postfix mailutils ubuntu-vm-builder libvirt-bin

disable floppy:

echo "blacklist floppy" | sudo tee /etc/modprobe.d/blacklist-floppy.conf
sudo rmmod floppy
sudo update-initramfs -u

Here is the output of /etc/netplan/50-cloud-init.yaml: (I don't know about this one, I do NOT have the cloud instance installed, so perhaps there is a problem with the actual installation of 18.04 LTS, because all accounts I have seen on this indicate this APPEARS to be a different version installed than what I am expecting.

network:
    version: 2
    renderer: networkd
    ethernets:
            switchports:
              # all cards on second PCI bus; unconfigured by themselves, will be added
              # to br0 below
              match:
                name: enp1*
              mtu: 4400
    bridges:
      # the key name is the name for virtual (created) interfaces; no match: and
      # set-name: allowed
      br0:
        # IDs of the components; switchports expands into multiple interfaces
        interfaces: [switchports]
        addresses: [172.16.5.20/24]
        gateway4: 172.16.5.1
        nameservers:
          addresses: [172.16.5.2]
        parameters:
          forward-delay: 0
          stp: false

sudo netplan apply

As you can see, bridge 0 is up and good, able to reach internet, able to ssh to host without issue.

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.16.5.20  netmask 255.255.255.0  broadcast 172.16.5.255

Below is the output of the command used to spin up the VM. I am a little confused at the errors seen, as they show as informational, and don't stop the setup. When trying to ping, I only get "dest host unreachable".

/$ sudo ubuntu-vm-builder kvm xenial \
>  --dest /Test/Chaos/Test.raw \
>  --hostname Test \
>  --arch amd64 \
>  --mem 4096 \
>  --cpus 4 \
>  --user tadmin \
>  --pass password \
>  --bridge br0 \
>  --ip 172.16.5.29 \
>  --mask 255.255.255.0 \
>  --net 172.16.5.0 \
>  --bcast 172.16.5.255 \
>  --gw 172.16.5.1 \
>  --dns 172.16.5.2 \
>  --components main,universe \
>  --addpkg openssh-server \
>  --addpkg linux-image-generic \
>  --rootsize=20000 \
>  --libvirt qemu:///system ;


2018-09-17 13:10:03,441 INFO    : logging to file: /tmp/tmp3MbyqN
2018-09-17 13:10:03,476 INFO    : Calling hook: preflight_check
2018-09-17 13:10:03,483 INFO    : Calling hook: set_defaults
2018-09-17 13:10:03,484 INFO    : Calling hook: bootstrap
2018-09-17 13:12:51,406 INFO    : Calling hook: configure_os
2018-09-17 13:12:57,667 INFO    : W: Can't drop privileges for downloading as file '/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_xenial_InRelease' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
Extracting templates from packages: 100%
2018-09-17 13:14:44,201 INFO    : W: --force-yes is deprecated, use one of the options starting with --allow instead.
2018-09-17 13:14:44,202 INFO    : W: Can't drop privileges for downloading as file '/var/cache/apt/archives/partial/libglib2.0-0_2.48.2-0ubuntu4_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
2018-09-17 13:14:45,839 INFO    :
2018-09-17 13:14:45,840 INFO    : Current default time zone: 'Etc/UTC'
2018-09-17 13:14:45,842 INFO    : Local time is now:      Mon Sep 17 13:14:45 UTC 2018.
2018-09-17 13:14:45,843 INFO    : Universal Time is now:  Mon Sep 17 13:14:45 UTC 2018.
2018-09-17 13:14:45,843 INFO    :
2018-09-17 13:14:48,138 INFO    : Generating locales (this might take a while)...
2018-09-17 13:14:49,088 INFO    :   en_US.UTF-8... done
2018-09-17 13:14:49,088 INFO    : Generation complete.
Extracting templates from packages: 100%
2018-09-17 13:15:50,805 INFO    : W: --force-yes is deprecated, use one of the options starting with --allow instead.
2018-09-17 13:15:50,805 INFO    : W: Can't drop privileges for downloading as file '/var/cache/apt/archives/partial/base-files_9.4ubuntu4.7_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
2018-09-17 13:15:53,842 INFO    : Cleaning up
2018-09-17 13:15:53,842 INFO    : Calling hook: preflight_check
2018-09-17 13:15:53,939 INFO    : Calling hook: configure_networking
2018-09-17 13:15:53,954 INFO    : Calling hook: create_partitions
2018-09-17 13:15:53,955 INFO    : Creating disk image: "/tmp/tmpBfFwBQ" of size: 21024MB
2018-09-17 13:15:53,972 INFO    : Adding partition table to disk image: /tmp/tmpBfFwBQ
2018-09-17 13:15:54,013 INFO    : Adding type 4 partition to disk image: /tmp/tmpBfFwBQ
2018-09-17 13:15:54,013 INFO    : Partition at beginning of disk - reserving first cylinder
2018-09-17 13:15:54,020 INFO    : Warning: The resulting partition is not properly aligned for best performance.
2018-09-17 13:15:54,041 INFO    : Adding type 3 partition to disk image: /tmp/tmpBfFwBQ
2018-09-17 13:15:54,048 INFO    : [0] ../../libparted/filesys.c:148 (ped_file_system_type_get): File system alias linux-swap(new) is deprecated
2018-09-17 13:15:54,048 INFO    : Warning: The resulting partition is not properly aligned for best performance.
2018-09-17 13:15:54,069 INFO    : Creating loop devices corresponding to the created partitions
2018-09-17 13:15:54,296 INFO    : Creating file systems
2018-09-17 13:15:54,302 INFO    : mke2fs 1.44.1 (24-Mar-2018)
2018-09-17 13:15:55,459 INFO    : Calling hook: configure_mounting
2018-09-17 13:15:55,469 INFO    : Calling hook: mount_partitions
2018-09-17 13:15:55,470 INFO    : Mounting target filesystems
2018-09-17 13:16:00,451 INFO    : Calling hook: install_bootloader
2018-09-17 13:16:03,607 INFO    : E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
2018-09-17 13:16:05,114 INFO    : Removing update-grub hooks from /etc/kernel-img.conf in favour of
2018-09-17 13:16:05,114 INFO    : /etc/kernel/ hooks.
2018-09-17 13:16:05,254 INFO    : Searching for GRUB installation directory ... found: /boot/grub
2018-09-17 13:16:05,259 INFO    : findfs: unable to resolve 'UUID=0eca356a-3113-4242-8b0f-fd8e5b4876bb'
2018-09-17 13:16:05,262 INFO    : Cannot determine root device.  Assuming /dev/hda1
2018-09-17 13:16:05,262 INFO    : This error is probably caused by an invalid /etc/fstab
2018-09-17 13:16:05,402 INFO    : Searching for default file ... Generating /boot/grub/default file and setting the default boot entry to 0
2018-09-17 13:16:05,404 INFO    : Searching for GRUB installation directory ... found: /boot/grub
2018-09-17 13:16:05,409 INFO    : Testing for an existing GRUB menu.lst file ...
2018-09-17 13:16:05,410 INFO    :
2018-09-17 13:16:05,410 INFO    : Could not find /boot/grub/menu.lst file. Would you like /boot/grub/menu.lst generated for you? (y/N) /usr/sbin/update-grub: line 1094: read: read error: 0: Bad file descriptor
2018-09-17 13:16:05,703 INFO    : W: --force-yes is deprecated, use one of the options starting with --allow instead.
2018-09-17 13:16:05,703 INFO    : W: Can't drop privileges for downloading as file '/var/cache/apt/archives/partial/libc6-i386_2.23-0ubuntu10_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
2018-09-17 13:16:12,288 INFO    : Searching for GRUB installation directory ... found: /boot/grub
2018-09-17 13:16:12,292 INFO    : findfs: unable to resolve 'UUID=0eca356a-3113-4242-8b0f-fd8e5b4876bb'
2018-09-17 13:16:12,294 INFO    : Cannot determine root device.  Assuming /dev/hda1
2018-09-17 13:16:12,295 INFO    : This error is probably caused by an invalid /etc/fstab
2018-09-17 13:16:12,430 INFO    : Searching for default file ... found: /boot/grub/default
2018-09-17 13:16:12,434 INFO    : Testing for an existing GRUB menu.lst file ...
2018-09-17 13:16:12,434 INFO    :
2018-09-17 13:16:12,434 INFO    : Could not find /boot/grub/menu.lst file.
2018-09-17 13:16:12,434 INFO    : Generating /boot/grub/menu.lst
2018-09-17 13:16:12,514 INFO    : Searching for splash image ... none found, skipping ...
2018-09-17 13:16:12,714 INFO    : Found kernel: /boot/vmlinuz-4.4.0-135-generic
2018-09-17 13:16:12,860 INFO    : Updating /boot/grub/menu.lst ... done
2018-09-17 13:16:12,860 INFO    :
2018-09-17 13:16:13,085 INFO    : Searching for GRUB installation directory ... found: /boot/grub
2018-09-17 13:16:13,092 INFO    : findfs: unable to resolve 'UUID=0eca356a-3113-4242-8b0f-fd8e5b4876bb'
2018-09-17 13:16:13,094 INFO    : Cannot determine root device.  Assuming /dev/hda1
2018-09-17 13:16:13,094 INFO    : This error is probably caused by an invalid /etc/fstab
2018-09-17 13:16:13,233 INFO    : Searching for default file ... found: /boot/grub/default
2018-09-17 13:16:13,239 INFO    : Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
2018-09-17 13:16:13,373 INFO    : Searching for splash image ... none found, skipping ...
2018-09-17 13:16:13,434 INFO    : Found kernel: /boot/vmlinuz-4.4.0-135-generic
2018-09-17 13:16:13,556 INFO    : Replacing config file /run/grub/menu.lst with new version
2018-09-17 13:16:13,626 INFO    : Found kernel: /boot/vmlinuz-4.4.0-135-generic
2018-09-17 13:16:13,758 INFO    : Updating /boot/grub/menu.lst ... done
2018-09-17 13:16:13,758 INFO    :
2018-09-17 13:16:13,821 INFO    : Searching for GRUB installation directory ... found: /boot/grub
2018-09-17 13:16:13,861 INFO    : Calling hook: install_kernel
2018-09-17 13:16:14,686 INFO    : E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
2018-09-17 13:16:15,077 INFO    : W: --force-yes is deprecated, use one of the options starting with --allow instead.
2018-09-17 13:16:15,077 INFO    : W: Can't drop privileges for downloading as file '/var/cache/apt/archives/partial/linux-image-virtual_4.4.0.135.141_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
2018-09-17 13:16:15,078 INFO    : Calling hook: post_install
2018-09-17 13:16:15,078 INFO    : Calling hook: unmount_partitions
2018-09-17 13:16:15,079 INFO    : Unmounting target filesystem
2018-09-17 13:16:18,978 INFO    : Calling hook: convert
2018-09-17 13:16:18,979 INFO    : Converting /tmp/tmpBfFwBQ to qcow2, format /Test/Chaos/Test.raw/tmpBfFwBQ.qcow2
2018-09-17 13:16:20,862 INFO    : Calling hook: fix_ownership
2018-09-17 13:16:20,865 INFO    : Calling hook: deploy
/$
/$
/$ virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     Test                           shut off

/$
/$ virsh start Test
Domain Test started

/$
/$
/$ ping 172.16.5.29
PING 172.16.5.29 (172.16.5.29) 56(84) bytes of data.
From 172.16.5.20 icmp_seq=1 Destination Host Unreachable
From 172.16.5.20 icmp_seq=2 Destination Host Unreachable
From 172.16.5.20 icmp_seq=3 Destination Host Unreachable
^C
--- 172.16.5.29 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3062ms
pipe 4
/$
3
  • You probably have, but just to be sure, you've enabled hardware virtualization technology on your CPU right? Sep 17, 2018 at 14:12
  • Thank you for the response. If you mean the BIOS, then yes, it is set there. this box was running 14.04 with VMs running without issues for 3 years, until the old SSD I had in it for the main OS crapped out. I am wondering and questioning myself if there is a package I forgot to install at this point... /$ sudo kvm-ok INFO: /dev/kvm exists KVM acceleration can be used
    – Ziggidy
    Sep 17, 2018 at 14:39
  • Open virt-manager and take a look. Sep 19, 2018 at 12:46

1 Answer 1

0

Eliminating duplicates, here's what your ubuntu-vm-builder script log says (brevity in logvomit is to be desired):

2018-09-17 13:10:03,441 INFO    : logging to file: /tmp/tmp3MbyqN

You should look at (not post) this file.

2018-09-17 13:12:51,406 INFO    : Calling hook: configure_os
2018-09-17 13:12:57,667 INFO    : W: Can't drop privileges for downloading as file '/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_xenial_InRelease' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

The _apt user tried, but failed to access /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_xenial_InRelease. Is there a /partial update outstanding? Or use my pathlld script ( https://github.com/waltinator/pathlld.git ) to investigate. Use getent passwd _apt to find the UID and GID for _apt.

2018-09-17 13:14:44,201 INFO    : W: --force-yes is deprecated, use one of the options starting with --allow instead.

This is not your problem - it belongs to the package developer.

2018-09-17 13:15:54,048 INFO    : [0] ../../libparted/filesys.c:148 (ped_file_system_type_get): File system alias linux-swap(new) is deprecated

This is not your problem - it belongs to the package developer.

2018-09-17 13:16:03,607 INFO    : E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)

This is a Major problem - /dev/pts is mounted very early in the bootup process through /etc/rcS.d/S04mountdevsubfs.sh. Your VM is very broken.

2018-09-17 13:16:05,259 INFO    : findfs: unable to resolve 'UUID=0eca356a-3113-4242-8b0f-fd8e5b4876bb'

Is UUID=0eca356a-3113-4242-8b0f-fd8e5b4876bb one of your real disks? Shouldn't it be looking at /tmp/tmpBfFwBQ? To what does the UUID refer?

2018-09-17 13:16:05,262 INFO    : Cannot determine root device.  Assuming /dev/hda1
2018-09-17 13:16:05,262 INFO    : This error is probably caused by an invalid /etc/fstab

BAD ASSUMPTION! It's looking at device /dev/hda1 as /, to search for /etc/fstab. This is NOT what you want. It's your real, not virtual, / partition. mount | grep hda1 will show.

2018-09-17 13:16:05,404 INFO    : Searching for GRUB installation directory ... found: /boot/grub
2018-09-17 13:16:05,409 INFO    : Testing for an existing GRUB menu.lst file ...
2018-09-17 13:16:05,410 INFO    :
2018-09-17 13:16:05,410 INFO    : Could not find /boot/grub/menu.lst file. Would you like /boot/grub/menu.lst generated for you? (y/N) /usr/sbin/update-grub: line 1094: read: read error: 0: Bad file descriptor

Bad file descriptor means that, at line 1094, /usr/sbin/update-grub tried to read a response from STDIN, but couldn't, since it's running in a broken system.

2018-09-17 13:16:18,979 INFO    : Converting /tmp/tmpBfFwBQ to qcow2, format /Test/Chaos/Test.raw/tmpBfFwBQ.qcow2

There's your (broken) VM.

1
  • I appreciate your response! I am looking through this, and I am not fully understanding why there are so many errors, unless I am missing a package that needs o be installed or something along those lines. I am going to take a look at your script and figure out how to run it. With the mount points, I am going to try to put the VM on the OS drive, as that should prevent any issues. I ran the VM spinup as root, so it should have had access to everything. I looked up that UUID, and nothing found. Regarding /dev/hda, there is n device by that name.
    – Ziggidy
    Sep 18, 2018 at 19:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .