Ensuring virtual machine survives Fedora clean install - virtualization

I am running Win 10 in a virtual machine under Fedora 30. I now need to do a clean install of Fedora 32. It is critical that the virtual machine survives this install.
The default location of virtual machines is under /var/lib/libvirt, which will will be run over by installation. Because of this, I now created a new pool onto a logical volume that will survive fresh OS install and used virt-clone to clone the virtual machine onto this logical volume. The cloned virtual machine is running just fine.
I can see that in the logical volume where the clone is the only file is the .qcow2-file containing the cloned virtual machine. I have two questions:
In order for the virtual machine to survive clean OS installation, is it sufficient that the .qcow2-file carries over? Or do I need to copy other information from some other directory?
After OS install, how do I tell virt-manager about the pool that already exists and the virtual machine that is located there?

You also need to at least copy the guest XML configuration files, which are stored under sub-dirs of /etc/libvirt.
If you've stored other things like snapshots, further dirs under /var/lib/libvirt may need to be preserved.
If you save the XML files somewhere, then in the new install "virsh define $XMLFILE" will load the guest into libvirt, such that virt-manager will see it again. You can use virt-manager's storage management UI to tell it about the pool.

Related

how to make a solaris system environment same as another

I have a real host and an vm. they are both solaris system
sjcux-c7build01# uname -a
SunOS sjcux-c7build01 5.8 Generic_Virtual sun4v sparc sun4v
The real host has been used for years.The vm is new created.For maintenance,we want to use vm instead of real host in future.I need to install all the packages and let the vm can do gnu make like the old host.
How to list all the packages the real host has installed?
pkginfo just shows what's bundled with Solaris.
I noticed that directory /usr/local/lib in vm is empty,And In real host ,it has many .so file in it.
There must be many other difference. How to find out them? How to list the packages I need to install?
For example.on the vm ,I can't use git.
ldd git
libiconv.so.2 => /tools/sw/opt/SunOS/5.8/git/git-2.23.0/lib/libz.so/lib/libiconv.so.2 - Not a directory
libintl.so.8 => /tools/sw/opt/SunOS/5.8/git/git-2.23.0/lib/libz.so/lib/libintl.so.8 - Not a directory
So libiconv need to be installed.
I want to make the vm same as the real host, what need I to do? Who can give me some guide~
It is unrealistic to find one by one according to the .so files.
One possible way is to create flash archive of your old machine and install from this archive:
create repository where to store the archive
create flash archive of the system
check the archive
export via NFS the flash archive store
on new machine boot from CD, choose installation media select NFS
For more detailed instruction you can check this article in my blog
After creation of new machine you should take care of changing IP address or unconfigure and configure it from scratch (in sense of network and authentication services) it because two machines will have the same IP.

Virtual machine "Cloudera quick start" not booting

I have recently download "QuickStart VM" on http://www.cloudera.com
(precisely, the version of virtualbox)
This virtual machine use centOS (and my computer is a macbook air)
I can not fully start this virtual machine(and I do not know why)
I have attached a screenshot of the most advanced state of booting
I've discovered that when your screen appears to be frozen at that location, pressing [ESC] is apparently what you're supposed to do next.
Mine was there, sitting there for a few minutes, I clicked esc and then a whole list of things started checking and installing, then the Cloudera GUI popped up.
Had the similar issue. Fixed with:
Download cloudera-quickstart-vm archive.
Start Virtual Box.
Go to menu: File -> Import Appliance...
Choose cloudera-quickstart-vm-*-virtualbox.OVF file (from downloaded archive)
Follow hints and the new Virtual machine will be created using cloudera-quickstart-vm-*-virtualbox-disk1.VMDK
Enhance the new VM settings like: add CPUs, add RAM, etc.
Start the new VM, takes a few minutes.
Press ESC and rest of startup scripts would run with that. Finally you would land on Cloudera screen.
You may try with the last version, based on CentOS 6.5 (It perfectly works on my iMac, vmware and parallels)
Etan is right, it can be pretty long to initiate CentOS when you are in this particularly point, especially if you didn't modify the default parameters of the quickstart (1 o 2GB RAM, 1 core)
If your macbook have more than 4GB RAM, try to start the VM with 4GB RAM and 2 cores, it should be better. Don't forget you need more than 8GB RAM dedicated to the VM to correctly run the Cloudera Manager, too.

How to Access Guest Resources from Host?

I'm using virtualbox + vagrant to setup my dev environment. I've created a symlink at /vagrant/.ivy2 to resource (.jar) files stored on the guest (vm) at ~/.ivy2
While the symlink works and I'm able to traverse it in the vm, host applications like eclipse do NOT register the contents of the symlink. Is there a way for me to expose the resources with the guest os home directory via symlink or otherwise to the host?
Are you running the latest version of Vagrant? I don't think you should be having any issues with this...
Regardless if you want to try a different method of exposing the guest to the host there are several options that you could use, depending on your preference:
sshfs - http://fuse.sourceforge.net/sshfs.html
Samba - https://help.ubuntu.com/community/Samba
AFP - http://en.wikipedia.org/wiki/Apple_Filing_Protocol

Vagrant Berkshelf - Shelf Path?

Is it possible to set the path where the berkshelf plugin puts the cookbooks it installs? (As in the .berkshelf folder)
I am running Windows 7.
I am currently trying to install a mysql server using an opscode cookbook to a vm and here at work they have the %HOMEDRIVE% system variable set to a network drive. So when .berkshelf starts at the beginning of the Vagrantfile, it pushes the cookbooks to the network drive and it causes it to be slow and well, its not where it should be. Is there a fix to this?
VirtualBox did this as well, but I fixed it by altering the settings. I tried looking for some sort of equivalent settings for berkshelf, but the closest I got was for the standard berkshelf (thats not a vagrant plugin), it appears you can set this environment variable:
ENV['BERKSHELF_PATH']
Found here:
http://www.rubydoc.info/github/RiotGames/berkshelf/Berkshelf#berkshelf_path-class_method
I need to be able to have the cookbooks it reads from the berksfile store to my laptops local drive instead, as in my scenario I cannot have the mobility of the VM limited to the building because of files that are stored on the network.
Any incite would be much appreciated.
Perhaps its better to use the actual berkshelf over the vagrant plugin?
Thanks.
If you want to have the portability - a full chef-repo ready for chef-solo runs, better off using standalone berkshelf instead of the vagrant-berkshelf plugin - which is NOT that flexibly.
For complex cookbooks, I prefer to use standalone berkshelf as it allows me to do berks install --path chef/cookbooks to copy all cookbooks required from ~/.berkshelf/cookbooks, then I can just tar the whole thing and transfer to other machines for the same chef-solo run. some people use capistrano automate the tar and scp/rsync over the network. I just use rysnc/scp;-)
HTH

XEN How to put virtual machines in a directory other than /etc/xen

On my CentOS 5.2 box the XEN virtual machine configuration files have to be located
in /etc/xen to be started without specifying a path.
I want to move my virtual machines into /etc/xen/vm to separate them from the
configuration files of the xen server.
Is there an easy way to change the default directory from /etc/xen to /etc/xen/vm ?
The easiest way to do it is to follow this tutorial, use xen-tools to generate VMs for you, and specify where you want to put your VMs. You can then just modify a config file in there (xen-tools.conf) and change the dir property:
dir = /etc/xen/vm
There's a little extra work involved since you're on CentOS (and it's a lot easier if you're on Ubuntu), but it's still do-able.