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
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.
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
Related
Is it a good practice to install ROS (Robot Operating System ) on Windows 10 using a virtual machine ? Are there any limitations that I would face doing so ?.
I know its a basic and simple question. But as a beginner I think I must get help on here
As far as ROS itself is concerned, running it in a Linux VM should be fine. Depending on your usage you may run into trouble brought by software used alongside ROS.
Gazebo for example will likely run very slowly if at all on a VM (though it's true this again depends on hardware). I was unable to get it to run properly on an Ubuntu VM so I just started using Ubuntu as the host OS.
Try dual booting Windows and Ubuntu if you cannot drop Windows entirely.
MY code will be deployed on FreeBSD. Would I be able to code using VS2010 in Win7? can this be done on Linux using gcc? or do I need to have freebsd installed on my laptop.
I plan on buying a new ultrabook and not sure FreeBSD will support the drivers or wireless. What the best practice here? VMs?
Thanks mods.
You can just write code in Visual Studio, however you will not be able to compile and run it in Windows, unless you are only using standard libraries.
To compile and test your code you need a FreeBSD somewhere.
I have never used FreeBSD on a laptop, so I can't say if dualbooting it with Windows is a good idea.
The best thing would be if you had access to a test server with the same configuration as your production server (i.e. same FreeBSD version, same packages, etc.). Then you could write code in VS, check it into a repository, SSH to the server, update a local copy of the source there and build.
If that is not an option, I recommend setting up a virtual environment. Download VirtualBox, obtain FreeBSD and install it on the VM. Set up port forwarding for SSH and then the process is pretty much the same as with a separate server. You may have to make some additional tweaks depending on the nature of the work you'll be doing.
Here is a setup I have used in cases where I am not using any OS specific library.
On your Windows 7 machine develop your application as usual without using MFC/ATL etc. If you are linking to external libraries/APIs you will have to use one which is portable across Windows and Linux (e.g. Boost libraries). Do not use pre-compiled headers (stdfax.h) or any other option which is Windows specific.
Get VirtualBox and install your favorite OS (FreeBSD in this case) and your favorite tool chain (gcc clang)
Share the disk/folder you are developing your app in the Windows file system so that it is visible in VirtualBox. In Ubuntu they end up in the /media/sf_Folder.
Compile in FreeBSD in VirtualBox. You will need to have an alternative make system setup in parallel in addition to the stuff Visual Studio creates. Make sure you do not have any conflicts in the way the directories used by the build system (to store object files etc.) between FreeBSD and Windows. You can try out this http://code.google.com/p/make-it-so/ to convert your VS solutions to gcc makefiles.
This way you can continue to use your favorite IDE and also rebuild on your target *ix OS on the same machine.
gcc + gvim + ( ( ctags with omnicppcomplete ) or ( clang with clang_complete ) and STL + Boost.
This question may seem blindingly obvious and I realise I am putting myself up for a large number of downvotes but I am very new to Linux dev and have only been working on it for a while.
I have been writing an application on ubuntu 12.04 (kernel 3.2.0) in C++ then copying this via scp to an ubuntu 8.04 (kernel 2.6.30) installation on another device. I have been noticing some very strange behaviour that I simply cannot explain. I have naively assumed that I can run this executable on a previous version, but it is beginning to dawn on me that this in fact may not be the case. In future must I ensure that the Linux version I build my application on is identical to that which it will be running on in the field?? Or must I actually build the application from source code directly on the device it will be running on??? I am very new to Linux dev but not new to C++ so I realise that this question may seem facile, but this is the kind of issue that I have simply not seen in books/tutorials etc.
Most of the time, it's not the kernel that stops you, it's glibc.
glibc is backwards compatible, meaning programs compiled and linked to an older version will work exactly the same with a newer version at runtime. The other way around is not that compatible.
Best is of course to build on the distro you want to run it. If you can't do that, build on the one with the oldest glibc install.
It's also very hard to build and link to an older glibc than the system glibc, installing/building glibc tends to mess up your system more than it's worth. Set up a VM with an old Linux, and use that instead.
I need to use Eclipse on a Linux Virtual Box virtualization, Windows XP host, on a laptop. I don't know the specs of that laptop, but it's less than 2 years old.
My first choice of Linux distribution is Ubuntu, but I've heard that in Ubuntu, Eclipse is can be bugged or slow. I don't mind if it's slow. I only need to know if there is a risk that it might not work, since I have a limited time to install and try that.
I would also like to know about any other linux distribution that does or does not work fine for you with Eclipse.
Note: I only need to build a C++ project.
Eclipse runs on Java.
Any linux distro (apart from command line ones) will do.
If you like Ubuntu go with it!
Ubuntu will work just fine as an OS. I use eclipse in Ubuntu running on a VM in a cloud somewhere. So I can just remote desktop into it and pick up where I left off.
Ubuntu should be OK. Just make sure to use the Sun's official Java (its in the repository) and not the openjdk (which is the default). For what I hear, this may speedup the things a little bit.
Disclaimer: I did not try to replace java.
I'd hesitate at suggesting a distro like Ubuntu for your machine -- look at something like Arch which is simple to setup and relatively lean.
I have a small piece of code that works as a plugin for a larger graphics application. The development platform is Qt with c++ code. I've managed to build a .so, .dylib and .dll for linux, MacOS and Windows respectively, but to do so I had to have a machine running each operating system (in my case, running linux [ubuntu] gcc natively, and windows MinGW and MacOS XCode gcc in virtual machines).
Is there a way to build for all 3 platforms from one? I beat my head against this problem a while back, and research to date suggests that it's not easily (or feasibly) done. The code only needs to link against a single header that defines the plugin
API and is built from a fairly basic Makefile (currently with small variations per platform).
You should have a look at crosscompiling.
You basically build a compiler that (on your current plattform) will output binaries for your desired platforms.
Try this link about doing it on linux, for windows, with QT
Better late than never, I just came across IMCROSS
It looks quite promising!
For Linux it is fairly easy to setup or even download a virtual machine using VMWare for instance. Getting OSX to run on VMWare is somewhat tricky but possible.
Running VMWare and sharing a directory on a local drive you can even compile for the different platforms using the same exact files.
There is somewhere a cross-compiler for OSX but I wouldn't trust it to be of great quality.