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

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.

Related

Ensuring virtual machine survives Fedora clean install

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.

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.

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

Netbeans: Remote project w/source files over SSH?

Is it possible to set up a remote NetBeans C++ project where the source files are only accessible via SSH?
My project needs to build on a Linux box, but I'd like to develop it on a Windows machine.
Checking out the code via SVN to my Windows machine is not an option since there are a few files that differ only by case, and NTFS is not case sensitive (unfortunately, I can not change them).
I'm well aware that Windows can be kind-of forced be case-aware and the ideal solution is to just re-name those file to something sane.
However, I'm just trying to solve this using NetBeans. Since it's a remote project anyway, why bother to keep any files locally.
Thanks
Currently, no. In general programming files with different cases of the same name is a bad practice.
You can enable case sensitivity in Windows - you may need to have a Professional version or better.
For Windows XP: http://support.microsoft.com/kb/817921
For Windows 7: http://technet.microsoft.com/en-us/library/cc732389.aspx
See also: Windows Services for Unix
Another solution would be to setup VNC/RDP on the remote Unix system. The overall solution should be to conform to a better file naming convention:
Programmer 1: "Hey man, take a look at noCamelCase.cs - I just rewrote it."
Programmer 2: "Um, nocamelcase.cs is blank."
There are two ways of doing remote builds with Netbeans. The first, the project is stored locally. You just create a regular project and on the 2nd page of the wizard you specify the network directory with the source and the remote build host. I've used this for Solaris client to Linux server, but not from Windows as we don't have the mounts exported by SMB. This uses ssh and some shared lib interposers to get the build info.
The second way is to create a remote project. In this case the project is created on the remote host and date is copied on demand to the client. I've only doe a few tests with this as I preferred the first method as it had much better latency.
Lastly, you could either use vnc or install X on your windows machine and do everything on the Linux machine.

Howto share NetBeans profile across 3 computers and 4 separate OS's (Windows and Linux)?

I use 3 different computers and 4 separate OS's (Windows and Linux) and want to take the pain out of making sure plugins are installed correctly, formatting settings are the same, other settings are the same, etc. I don't want to copy them.
Sharing across multiple windows installations is easy, I just need to set the --userdir switch to the location. However one of the OS's is Ubuntu linux, and from this post, it looks like its not going to work.
I heavily use both Windows and Linux for development, so this is an issue. What can I do to make the profile cross compatible? Better yet, is there a plugin that does this automatically?
I have been doing this for quite some time now. Basically here's how I did it
I have a .netbeans folder on my portable hard drive which contains the profile
Each machine has their own netbeans installation due to performance issues. All I do is modify the etc/netbeans.conf configuration file and set it to the path thats for that machine (remember that the drive mounts on different letters and locations)