We have to ssh into our school's server to make sure our programming assignments work on the system that will be used to test them by the teacher. It's running RHEL 6.2. When I test my program on my Mac running RHEL 6.2 in VirtualBox, I get different results than the school's. Are there any steps I can take to get my RHEL running similarly enough to the school's so that we get the same results, or are there too many variables for it to be plausible (hardware, root settings, etc)?

EDIT: The programming is in C++ for an Operating Systems class. We're working with system calls and whatnot. It's using tcsh, g++...other than that I'm not sure what else you'd need to know? This is my first unix/linux class.

  • 2
    What programming is this? The results shouldn't be different for most kinds of programming even in Windoze! [I am assuming C/C++ type programming and not bash/csh]
    – user14517
    Feb 12, 2012 at 4:40
  • 1
    While you could attempt to clone an entire school machine into a virtual machine, it would probably easier to set up a similar development and runtime environment. You already said that you have the same OS, but you've left out other important details like what sort of programming you are doing as well as what language you are using and what version of the compiler or interpreter the school uses.
    – jw013
    Feb 12, 2012 at 4:45
  • 7
    Too general to say anything. Please give a specific example of different results. Feb 12, 2012 at 5:31
  • 2
    It would be nice to give some examples of the "different results" you see. For starters, make sure you are using the same compiler versions and flags on both systems.
    – jw013
    Feb 12, 2012 at 5:42
  • 2
    Behavior like that is going to be difficult to get consistent. It sounds like issues from uninitialized variables upon which the behavior is quite random. It all depends on what was last using the address space your variable now occupies, so matching the EXACT library versions between your machine and the school's is going to be as close as you can get, but you will likely never get it identical.
    – phemmer
    Feb 12, 2012 at 6:38

2 Answers 2


You are attempting to do the opposite of what you should be doing. If your desire is to find and fix bugs, so that you don't submit programs with bugs, you should use two environments that are as different as possible. That way, if one platform doesn't fail due to a bug, there's a chance you'll be able to catch the bug on the other platform.

Your goal should be to write working software, not software that happens to work when you tried it.

  • hmm good point. i agree. but ultimately, my goal is to pass the class. so if it works on the school's computer and not mine, i wouldn't be too concerned. but that is a good point. Murphys huh? I have family there.
    – Marty
    Feb 12, 2012 at 7:56
  • 3
    If your code has bugs, there's a good chance you'll get marked down because of it, even if it "happens to work". Worse, the code may work when you try it and then fail when others try it. You don't want to submit code with unknown bugs. Plus, by not finding and fixing any bugs you write, you'll persist in writing code with those bugs, you'll learn slower, and your grades will likely suffer eventually. (Yep, Murphys. Near scenic Angels Camp.) Feb 12, 2012 at 8:05

If you want an environment as close as possible to the one at school, ask them what they run and the configuration they use for automated (re)installation of lab machines (you'll probably need to tweak it extensively, so it doesn't assume centrally handled authentication or $HOME mounted over the network, and leave out closed software to which you don't have a license). If they use RHEL and can't allow you to use the same, go for a clone like CentOS (aims at binary compatibility).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .