Hi, I am using Tiny Core Linux for the guests running on KVM. Is it possible to use libguestsfs tools for this kind of VMs? For example, VM_TC (the name of the VM provided in libvirt) uses a qcow2 disk image. This disk image is created from iso file of Tiny Core Linux using qemu-img utility. My host is ubuntu 12.04. I have tried to use virt-ls tool but could not succeed and is receiving the following error. Your help in this regard is highly appreciated. virt-ls -d VM_TC / virt-ls: no operating system was found on this disk If using guestfish '-i' option, remove this option and instead use the commands 'run' followed by 'list-filesystems'. You can then mount filesystems you want by hand using the 'mount' or 'mount-ro' command. If using guestmount '-i', remove this option and choose the filesystem(s) you want to see by manually adding '-m' option(s). Use 'virt-filesystems' to see what filesystems are available. If using other virt tools, this disk image won't work with these tools. Use the guestfish equivalent commands (see the virt tool manual page). Regards Arup Raton Roy Graduate Student David R. Cheriton School of Computer Science University of Waterloo, Ontario, Canada
Richard W.M. Jones
2014-Mar-23 12:26 UTC
Re: [Libguestfs] About Guest running Tiny Core Linux
On Sat, Mar 22, 2014 at 04:03:11PM -0400, Arup Raton Roy wrote:> Hi, > > I am using Tiny Core Linux for the guests running on KVM. Is it > possible to use libguestsfs tools for this kind of VMs?Yes. There are two caveats: Firstly inspection might not work for all guests. To understand what inspection is, see: http://libguestfs.org/guestfs-faq.1.html#whats-the-deal-with-guestfish--i Secondly, we should be able to inspect all Linux guests, including Tiny Core Linux, but it looks like in this case it is failing. This is a bug.> For example, VM_TC (the name of the VM provided in libvirt) uses a > qcow2 disk image. This disk image is created from iso file of Tiny > Core Linux using qemu-img utility.I'm not clear exactly on how you are creating the guest. Can you show us what commands you use to go from the ISO file to the guest? Also can you use: qemu-img info disk.img and: virt-filesystems --all --long -h -a disk.img to show us exactly the format of the container and the partitions etc inside the container.> My host is ubuntu 12.04. I have tried to use virt-ls tool but could > not succeed and is receiving the following error. Your help in this > regard is highly appreciated. > > virt-ls -d VM_TC / > virt-ls: no operating system was found on this disk[...] You should enable debugging by setting the environment variables shown here: http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs Then send us the complete, unedited output from the virt-ls command. It will help us to diagnose exactly why inspection is failing. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Richard W.M. Jones
2014-Mar-23 15:19 UTC
Re: [Libguestfs] About Guest running Tiny Core Linux
On Sun, Mar 23, 2014 at 12:26:28PM +0000, Richard W.M. Jones wrote:> Secondly, we should be able to inspect all Linux guests, including > Tiny Core Linux, but it looks like in this case it is failing. This > is a bug.I had a look at how the Tiny Core Linux ISO is arranged. It loads the main operating system root partition as a single large initramfs, with optional modules loaded [somehow -- not sure of the exact mechanism] as squashfs filesystems. There's nothing wrong with that of course, but it makes it challenging to have 'guestfish -i' open with the TCL root filesystem, and thus programs like 'virt-cat', 'virt-ls' etc are unlikely to work in the way you expect. There's probably not much we can do except have inspection simply identify that it is TCL. I have filed a bug about this: https://bugzilla.redhat.com/show_bug.cgi?id=1079734 Rich. ---------------------------------------------------------------------- Opening the ISO file: $ guestfish --ro -a TinyCore-current.iso Welcome to guestfish, the guest filesystem shell for editing virtual machine filesystems and disk images. Type: 'help' for help on commands 'man' to read the manual 'quit' to quit the shell><fs> run ><fs> list-filesystems/dev/sda1: iso9660><fs> mount /dev/sda1 / ><fs> ll /boottotal 8720 dr-xr-xr-x 3 root root 2048 May 26 2013 . dr-xr-xr-x 4 root root 2048 Jan 24 13:49 .. -r--r--r-- 1 root root 5981138 Jan 24 13:49 core.gz dr-xr-xr-x 2 root root 2048 May 26 2013 isolinux -r--r--r-- 1 root root 2941168 Jan 24 13:49 vmlinuz><fs> download /boot/core.gz /tmp/core.gz ><fs> ll /cde/optionaltotal 4590 dr-xr-xr-x 2 root root 10240 Jan 24 13:49 . dr-xr-xr-x 3 root root 2048 Jan 24 13:49 .. -r--r--r-- 1 root root 1273856 Jan 24 13:49 Xlibs.tcz -r--r--r-- 1 root root 44 Jan 24 13:49 Xlibs.tcz.md5.txt [etc]><fs> download /cde/optional/Xlibs.tcz /tmp/Xlibs.tcz ><fs> exitThe core initramfs: $ zcat core.gz | cpio -it | grep etc/ 17678 blocks etc/hostname etc/init.d etc/init.d/tc-functions etc/init.d/tc-restore.sh etc/init.d/tc_noscan.lst etc/init.d/dhcp.sh etc/init.d/tc-config etc/init.d/rc.shutdown etc/init.d/settime.sh etc/init.d/rcS etc/init.d/services etc/init.d/services/dhcp etc/init.d/services/tftpd etc/init.d/services/crond etc/modprobe.conf etc/passwd etc/gshadow [etc] An optional module: $ guestfish -a Xlibs.tcz Welcome to guestfish, the guest filesystem shell for editing virtual machine filesystems and disk images. Type: 'help' for help on commands 'man' to read the manual 'quit' to quit the shell><fs> run ><fs> list-filesystems/dev/sda: squashfs><fs> mount /dev/sda / ><fs> ll /usr/bin/total 137 drwxr-sr-x 2 root root 243 Aug 16 2013 . drwxr-sr-x 6 root root 63 Dec 15 2011 .. -rwxr-xr-x 1 root root 530 Jan 14 2011 desktop.sh -rwxr-xr-x 1 root root 873 Jan 14 2011 getRGB -rwxr-xr-x 1 root root 14000 Mar 8 2010 hsetroot -rwxr-xr-x 1 root root 7156 May 20 2010 mcookie -rwxr-xr-x 1 root root 649 Feb 8 2012 setupdesktop -rwxr-xr-x 1 root root 4052 Mar 4 2010 showrgb -rwxr-xr-x 1 root root 1234 Dec 22 2011 startx -rwxr-xr-x 1 root root 1932 Jun 9 2009 waitforX -rwxr-xr-x 1 root root 29672 Apr 18 2009 xauth -rwxr-xr-x 1 root root 7196 Apr 18 2009 xkill -rwxr-xr-x 1 root root 14376 Apr 18 2009 xlsfonts -rwxr-xr-x 1 root root 21852 Apr 18 2009 xmodmap -rwxr-xr-x 1 root root 29800 Apr 18 2009 xset lrwxrwxrwx 1 root root 9 Nov 7 16:13 xsetup -> xsetup.sh -rwxr-xr-x 1 root root 2820 Jan 14 2011 xsetup.sh -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org