32 or 64 bit installation from network

If I provide the URL [noparse]http://download.opensuse.org/distribution/11.3/repo/oss/[/noparse]](http://download.opensuse.org/distribution/11.3/repo/oss/) in a vm installation (with virt-install), how can I tell if it will install a 32 or 64bit version? Other distros (Fedora, Ubuntu, Mandriva) have a different directory for i386 and amd64 network install. I just need to put the correct urls in a script (so haven’t try to install yet).

The architecture of the OS will choose the appropriate directory within the repo. So it depends on what you used to do the base install.

Does it mean that I have to create explicitely a 32bit virtual machine in order to install a 32bit system or should the base url be more specific, like [noparse]http://download.opensuse.org/distribution/11.3/repo/oss/suse/x86_64/ or http://download.opensuse.org/distribution/11.3/repo/oss/suse/i686/[/noparse]? Here’s what the virt-install manpage says:

[noparse]Some distro specific url samples:

     Fedora/Red Hat Based
         http://download.fedoraproject.org/pub/fedora/linux/releases/10/Fedora/i386/os/
     Debian/Ubuntu
         http://ftp.us.debian.org/debian/dists/etch/main/installer-amd64/
     Suse
         http://download.opensuse.org/distribution/11.0/repo/oss/
     Mandriva
         ftp://ftp.uwsg.indiana.edu/linux/mandrake/official/2009.0/i586/[/noparse]

You can either boot with a 32-bit install media, e.g. 32-bit net installer image or LiveCD image, or if you have defined a 64-bit VM, you can choose to install a 32-bit OS, ignoring the “nice machine, but are you sure you want to install a 32-bit OS on a 64-bit CPU?” warning the installer pops up. The repo URLs are the same for both architectures; it will find the appropriate subdirectory. The openSUSE installer is smarter than the installer of the other OSes you have named.

Well, to put the question in other words: am I going to define a 32-bit VM to install a 32-bit OS or do I keep virt-install default: VM guest would have the same architecture as the host - mostly 64-bit - (not sure how many 32-bit CPUs support virtualization anyway). Knowing that a vm could use … let’s say up to 1GB of ram, the question is: am I going to create 32-bit VMs for that purpose (which means adding one more argument to my script). What do you think?

Yes, and so I wonder if the following argument will start an installation and, if so which one (32 or 64 bit):

virt-install  ....  --location [noparse]http://download.opensuse.org/distribution/11.3/repo/oss/[/noparse]

Looking at the other virt-install examples, this is not obvious. What did I miss? My first impression is that this parameter is not sufficient to install openSUSE or this path is incomplete. Well, actually, I just have to try it. I’ll find out.

  • I know that I can install from liveCD or iso images (I do it several times a week). That’s not what I’m trying to do (here).

It depends on what virt-install does. I looked it up and it apparently uses XEN. And the man page says this:

–arch=ARCH
Request a non-native CPU architecture for the guest virtual machine. The option is only currently available with QEMU guests, and will not enable use of acceleration. If omitted, the host CPU architecture will be used in the guest.

So it looks like you will get the same arch as the host; you have no choice.

virt-install seems to be a RH thing. Why not use the native XEN support in openSUSE?

It defines the vm and installs the OS from many different sources, including a URL.

I’m not using XEN. I’m using kvm. virt-install can use both. It first connects to an hypervisor with --connect=qemu:///system or --connect=xen:///system (for local examples). If it finds a XEN kernel, it will use XEN (I guess. So does virsh).

I do have the choice, as I am using QEMU guests. And so I would use --arch=i686 if it does make sense (I’m still not sure about that) for 32-bit OS.

Well, since you have 50/50 chance of getting one or the other, why not just give it a go. :slight_smile:

Because I’m not just installing a specific distro in a specific vm. I’m writing a script to install any distro in any vm, preferably in 32-bit guests (due to available ram) on 64-bit hosts. So I’m in the process of gathering the infos I need. And I was wondering why the openSUSE url example in virt-install manual doesn’t include the architecture in its path (unlike others) and how the installation would find out that I want to install a 32-bit OS in case the guest is a 64-bit vm. I’ll know more after trying this URL - which I suspect will not work (but I don’t know).

Well, sorry I’m out of ideas but maybe virt-install is smarter than you suspect and appends the arch to the URL? So give it a try already. :stuck_out_tongue: