views:

37

answers:

2

Hi,

I have Ubuntu 8.04 running on a Xen based VPS server that runs on a dual-core AMD Opteron 64-bit machine.

I have some locally developed C++ based daemons that I would want to deploy in that machine. My local machine is a 32 bit Ubuntu 9.04 running on an Intel core 2 duo laptop.

Can I execute binaries compiled from source code on my machine directly on the above mentioned server?

I am a newbie in this area. Would be great if someone could throw light on the standard practices in this kind of situation.

Thanks in advance

+1  A: 

Xen is a hypervisor on top of which OSes are expected to run. It isn't an OS itself, in the normal sense of the word, and you can't build stuff to run on it. Unless the "stuff" is an OS, of course.

EDIT: Since Ubuntu is running inside the hypervisor, Xen itself is somewhat irrelevant. Pretty much anything you can do inside a normal Ubuntu install you can also do inside a Xen-hosted Ubuntu.

WRT deploying 9.04-built code onto an 8.04 system, it will often just work, though you can hit problems with library dependencies. One trick that may help mitigate this if you get into problems is to use debootstrap (apt-get it). It allows you to deploy a minimal Ubuntu or Debian version of your choice into a chroot environment. I've never used it, so caveat lector. A more heavyweight, but cleaner, option is to run a VM on your own system (e.g., Sun VirtualBox) and run 8.04 on it for doing release builds.

Marcelo Cantos
Ubuntu 8.04 is running on the machine. Then how come other applications like python, apache etc are running on the server? Surely they must have been built from source code at some stage?
nano
The VM idea is awesome. Thanks!
nano
+1  A: 

It is best to develop with the same OS that you deploy on to minimize differences due to configuration and libraries. It might work, but it could also break in the future when updated libraries are installed. I suggest you get on the same OS or simply recompile the source on the target server

Chris Hafey
Thanks for the answer. Your point regarding using same OSes makes sense. What about the architecture difference? Like the server is AMD 64bit Opteron and local machine is Intel core2duo.
nano
AMD vs Intel shouldn't matter unless you use specific compiler flags to optimize for one or the other. Going 32 bit to 64 bit might work, but again it really depends. I am a big believer in making the dev environment as close to production as possible - it is usually possible and always saves me time in the end as I don't have to deal with the random differences that pop up
Chris Hafey