Does Mac OS X use Linux? - linux

The title says it all. At my job I've been asked to install a Ubuntu Linux system on a Virtualbox among other things so I can ssh into a development environment. This got me wondering about Operating Systems. I understand that Apple's is Mac OS X, but I just want to know if Mac OS X uses Linux or not. In August, I'm thinking of signing up for a Linux class on Edx.org so I can get better with the command line. I want to know if it will be a waste of time or not.
I've already looked up the history of Linux, Looked it up on Wikipedia, and googled it but surprisingly I didn't find an answer to this question. So once again, does Mac use Linux?

Mac OSX is built on top of BSD.
http://en.wikipedia.org/wiki/OS_X
Linux classes, in my opinion, are just fine and would enable you to be comfortable with the command line. The caveat is that there are differences such as the output or availability or options of commands. Instance is "ps". The system libraries, the folder structure are also different. Also note if you ever work on a *NIX server machine, invariably that would be linux. Note, there are no OSX servers anymore.

Mac OS X is based on BSD. BSD is similar to Linux but it is not Linux. However a big number of commands is identical.

Short answer: no
Mac OS X is based on Darwin, which is a descendant of Unix
It depends on the course, a shell scripting/bash course might be helpful since mostly the same commands are used, with some exceptions (some commands which are only specific to Mac OS X)

OSX uses Darwin, which is an OpenBSD variant. It is "UNIX-Like"
That means that while many aspects will be similar to linux, not EVERYTHING is the same.
For instance, the file system resembles linux, but has some differences such as the frameworks directories, /Applications, /Library, etc...

I started with Linux quite some time ago, at a point it gives you a pretty insight into how other systems work in general. But when you want to learn it just for an ssh from the terminal, you are effectively wasting your time. There is a command line on every operating system out there, unless it was prohibited from use by the administrator from the admin account. They need to kill the process completely, just to keep you away from it. On another hand, if you learn Linux, you would be able to adapt to the server environment because in the server rooms everything runs from the terminal. You can rarely find any enterprise architecture running on a GUI environment, and it gives you plenty of space for creativity because most of the applicants have never seen a server terminal equipment to begin with. Each terminal has their own language, so if you are learning OS X terminal it has a different set of terms than Windows terminal, Ubuntu terminal and other server equipment. In each one of them "learning" process is set from do-fail-repeat-fail-succeed-destroy-repeat. There is no single efficient way of doing that all.

Related

Comparative analysis between libkvm on linux and NetBSD

I want to build a sample program and as an initial step to learn KVM I started it from the link below.
http://www.linuxjournal.com/magazine/linux-kvm-learning-tool?page=0,1
I see that this is quite an old post for KVM, but I realize that the very first program does not compiles as it asks to include libkvm.h, which is not in my Ubuntu 13.04 installation.
To prepare for this program I installed qemu-kvm,dkms and libvirt stuff.
I also verified that the user has kvm and libvirtd in the group.
I am running Ubuntu on virtual-box on a modern i7 processor windows host.
So I have two different questions here -
1) Since I dont find libkvm.h in my box, what is the way compile my program and learn this kind of programming. If you have any tutorials please forward.
2) I got know that there is another libkvm that is used in BSD style Unix (e.g NetBSD/FreeBSD) that is used to access kernel data-strucrtures. From internet I see that GDB uses that library to fetch info from kernel memory. KVM in linux is a tool to create virtual machines on a Linux box. Is my understanding correct or is there anything more to it? Please provide a comparative analysis between these two libraries, namely libkvm on linux and libkvm on BSD?
As you already said, Linux KVM is a virtualisation technique whereas BSD kvm is much older, the acronym even expands to something different, and is a library to access (not only) kernel data structures in a defined manner.
They are totally separate and different things that have absolutely nothing to do with each other except for sharing the same acronym.
As do, for example, Keyboard-Video-Mouse switches. I was confused by all those Linux people talking about a “KVM” thing suddenly, back when Linux-KVM first came out, and not meaning those.

Cygwin vs Linux Virtual Machine for Development?

< skippable part >
I work in IT (mostly desktop support and network administration) in a Windows environment, and I occasionally program.
A couple weeks ago, I decided I couldn't be as effective as I want to be without a Bash environment for my command prompt needs. This is especially true when I am using Ruby and git. I used Msysgit for a while, but I just didn't like how it wasn't extensible like Linux. So, I installed Cygwin and played around with that for a couple weeks.
As great as Cygwin is, it seems like it is meant to be a suped up command prompt, and its compatibility with Linux is just a pleasant side effect. This especially became evident when I tried to upgrade Ruby to 1.9.3 (it worked, but it wasn't straightforward), install rvm (never worked), and install RMagick (may or may not work, but looks like a headache).
So, now I'm considering running Linux in a virtual machine. But I'm worried that might be another can of worms and I'll have wasted hours before I find that out. I like that Cygwin runs in Windows and I get to use my IDE, user folder, and more with it. But I don't like that support for it is not as thorough as for a major distro.
< /skippable part >
Does anyone here have insight on using Cygwin vs running a Linux virtual machine?
Any advice on setting up a Linux development environment in a virtual machine within Windows?
I have faced common issues before, and the best solution according to my experience is just 2 workstations :).
Apart from that having Linux running in a virtual environment is way better.
First of all, you will have full Linux capabilities (except 3d acceleration, but you probably don't need that).
You will have the capability of creating snapshots and revert back to them when things go wrong!
You can start multiple environment using templates, which is very convenient.
The only downfall I can think of is performance issues of the host machine.
If it's a normal workstation/PC, an IDE + one virtual machine + a 100+tabs browser just makes it slow.
1: cygwin is good for quick hacks, and for being able to acces host-os resources(you can run IE for example in a bash script). For something tightly integrated and some "real" word, go to a vm. It will emulate everything and separate development from the real machine, and this may be a good thing in some cases... as a plus it simulates a real server:)
2: in virtualbox at least, you have shared folders, and you can share a local folder, and see it in the vm as a local folder(local or as a windows share..it actually depends). Then you can use that "entry point" to symlink stuff into the vm, and do the things you need with the real files being located in the real(host) machine
SSH into a linux box. This is what everyone does. Why isn't this the answer?
There is something I have heard of called Cooperative Linux. It runs Linux alongside with Windows kernel so you can use them at the same time. I've never used it, but here:
http://www.colinux.org/
What I think now is getting the pros of 2 options is using
Docker
, it is giving you cygwin simplicity and VM functionality with better performance.
Linux in a virtual machine will give you the experience you want more than cygwin or any mock shell as I like to call them.
Running VM's though require a lot of ram depending on whether you want a desktop version of linux or just a command line version.
Myself in work I have a pc with 8gb of ram and I run ubuntu 64bit as main OS, two ubuntu servers (these are for dev environments two different projects) and a windows 7 VM and a win XP VM.
I can run the two ubuntu servers and one other VM at the same time, key here is more ram if you want to be able to do VM's.
If you're going to be working with Ruby then get an Ubuntu virtual machine up and running :) I've not tried Ruby, etc on Windows but I have heard that it is a pain to setup and configure. I use a Mac for all my Rails development so I cannot comment on the Windows side for that.
As for virtual machine creation, I prefer VMware Workstation, however there are free alternatives such as Virtualbox and VMware Server.
I'm using a Linux VM within a Windows seven environment as this VM is as representative as possible of the final production environment. The whole setup is binded to the Eclipse IDE under ms-Windows seven. So this is really great for local full testing, before committing or tagging the tested version to the production servers.
As you mentioned as well, this takes some time to get properly setup and fully configured. So if your need is only for little tricks or tasks, you may keep using cygwin. For example, I faced significant issues to configure perl and compile mysql within cygwin. So it's ok for basic usages, but not to fully take advantage of a full linux environment.
Your choice strongly depends on the final server setup purpose. A VM will do it whatever your need is. The setup cost for it is higher, so this time investment must be used often to get returned.

How to verify cross platform installation steps

I have to check installation steps of my application on different production machines. I want to check how can I install my application on HP UX. I have only linux/windows machines but dont have real physical HP unix machine. Is there any way i can check installation steps of HP unix. I am thinking of any virtual environment or any flavour that run on linux or windows which gives accessiblity and functionality of HP unix.
I am looking something to cross check platfrom installation steps.
The short answer is no. HP-UX is as different from Linux as Linux is from Windows (almost). There would be many differences in libraries, patches, installed utilities, build tools, etc.
A few examples:
HP-UX does not come pre-installed with the bash shell
HP-UX uses a proprietary software packager and installer called swinstall (analogous to RPM but completely different)
Partition layout is different
Many common utilities behave differently. "echo" is one of many examples. This will affect things if your build process uses shell utilities
Even if you can test the install, don't you need to test the product's operation on HP-UX?
Not saying it's impossible. If your application uses basic, nonspecific utilities for install, it might work. There is no way to know without a running installation. Unfortunately you need Itanium hardware and the O/S.
My recommendation would be to get your application working on Solaris and any other Unixes first. The more platforms you test on, the more portable your code will become on all of them. Then, put out some feelers and find someone with a system you can borrow time on.
Worst case, find an Itanium server like an rx2620 on eBay, should not cost too much. Even better if the seller forgets to wipe the O/S :). You'll need a terminal and possibly null modem. 11.31 (11iv3) is the latest version of the O/S.

Any lightweight *nix environment for programming

Is there any lightweight *nix OS dedicated for programming purposes?
Actually, I have a full installation of Mandriva in my computer; but sometimes in Windows I must use Virtualbox to run some *nix OS.
Because I only need the OS for only programming in this case, so I just want to ask you about it. Of course, I searched about this on the net; but I also want to have your opinions...
Basically I need C/C++, Java, Python environment.
The only Linux distro you should use is Arch Linux. Please read why it is so great for developers :)
I'm an Arch Linux user, so my opinion may be biased.
Actually, a machine that you do development on shouldn't be lightweight. It should be heavy. full of compilers, interpreters, profilers, debuggers, IDEs, editors, benchmarks, checked-out code from repos, development versions of system libraries, test suites, generated large test files, backup tools, virtual machines, chroots, music to set-up comfort environment, mail, office suite to do the paperwork.
I mean, install Putty and connect to your machine (a), or do all development on virtual machine (b), that is kept on external hard drive (that's what I did, when I needed this), so you can use it everywhere where VirtualBox can run.
As for linuxes, I personally would like to use Gentoo Linux, as it can be customized to be lightweight. But unless you're really experienced with all linux administration stuff, customization may take a lot of time. So as a (c) variant, I'd advise to use any distribution (like your Mandriva), because normally base system takes about 10% of "weight" that you need for development on top of that.
And, by the way, boot speed is irrelevant on VirtualBox, since you can save virtual machine state entirely on hard drive and restore it within seconds.
I recommend xubuntu. I keep a full programming environment on a 4GB thumb drive with me at all times... just in case. :-)
I have a Debian install with X, windowmaker, firefox, vim, gcc, make and dependencies. Also, source control tools. Not much more, other than stuff that's useful in shell scripts. About 1.4G used on disk. Boots quickly. Very little BS involved.
I used to use OpenBSD on my old laptop. Similar to the above, but even more minimalist. You upgrade the OS with tar and patch. :-) Very nice, very small. Only reason I switched away from it is because I got a new machine which needed ndiswrapper for wifi...
PS: seems like this should be a community wiki...
Don't forget about Cygwin, which gives you a Unix-like environment right within your Windows box.
What about something like Puppy or DSL?
They aren't dedicated to programming, but they are small and lightweight.
I'd use something like GRML.
It really depends on what you are trying to do in terms of development.
Questions I would ask myself before development.
a) Who is the audience of the applications?
b) Is it a web based application or a desktop application?
c) How heavy is the number crunching part?
The first questions sometimes dictate the programming language you will be using. If it is for system administrator, I believe you will be writing a console application with command line interface, that the choice would be using programming language like shell scripts languages, C, C++, and a few other script languages like Python and Ruby.
For second question, If you are doing a web based application or mobile application, you would need to get the SDK with the libraries, and it would pretty much dictate the environment you will be working on.
For the number crunching part, you would need to look into libraries like CUDA or Fortran libraries that are designed for these type of applications.
Personally I use the Gentoo and Puppy Linux distro. If you need do C, Java and python, you could just download the stage3 tar ball of Gentoo linux, download the SDK from Oracle, and you are set to go.
Sometimes people want to do the developement in Windows environment, and don't want to miss the Unix tools, using cygwin and mingw in Windows environment would be viable options.
I recommend trisquel mini is the best which is also ubuntu based. I am using it.I installed eclipse ide in it with 1 gb ram. It uses only 200 mb for running os for more information visit my https://hassan004.blogspot.com/2022/01/weight-linux-distro-trisquel-mini.html

shifting from windows to *nix programming platform

How to migrate to *nix platform after spending more than 10 years on windows? Which flavor will be easy to handle to make me more comfortable and then maybe I can switch over to more stadard *nix flavors?
I have been postponing for a while now. Help me with the extra push.
Linux is the most accessible and has the most mature desktop functionality. BSD (in its various flavours) has less userspace baggage and would be easier to understand at a fundamental level. In this regard it is more like a traditional Unix than a modern Linux distribution. Some might view this as a good thing (and from certain perspectives it is) but will be more alien to someone familiar with Windows.
The main desktop distributions are Ubuntu and Fedora. These are both capable systems but differ somewhat in their userspace architecture The tooling for the desktop environment and default configuration for system security works a bit differently on Ubuntu than it does on most other Linux or Unix flavours but this is of little relevance to development. From a user perspective either of these would be a good start.
From a the perspective of a developer, all modern flavours of Unix and Linux are very similar and share essentially the same developer tool chain. If you want to learn about the system from a programmer's perspective there is relatively little to choose.
Most unix programming can be accomplished quite effectively with a programmer's editor such as vim or emacs, both of which come in text mode and windowing flavours. These editors are very powerful and have rather quirky user interfaces - the user interfaces are ususual but contribute significantly to the power of the tools. If you are not comfortable with these tools, this posting discusses several other editors that offer a user experience closer to common Windows tooling.
There are several IDEs such as Eclipse that might be of more interest to someone coming off Windows/Visual Studio.
Some postings on Stackoverflow that discuss linux/unix resources are:
What are good linux-unix books for an advancing user
What are some good resources for learning C beyond K&R
Resources for learning C program design
If you have the time and want to do a real tour of the nuts and bolts Linux From Scratch is a tutorial that goes through building a linux installation by hand. This is quite a good way to learn in depth.
For programming, get a feel for C/unix from K&R and some of the resources mentioned in the questions linked above. The equivalent of Petzold, Prosise and Richter in the Unix world are W Richard Stevens' Advanced Programming in the Unix Environment and Unix Network Programming vol. 1 and 2.
Learning one of the dynamic languages such as Perl or Python if you are not already familiar with these is also a useful thing to do. As a bonus you can get good Windows ports of both the above from Activestate which means that these skills are useful on both platforms.
If you're into C++ take a look at QT. This is arguably the best cross-platform GUI toolkit on the market and (again) has the benefit of a skill set and tool chain that is transferrable back into Windows. There are also several good books on the subject and (as a bonus) it also works well with Python.
Finally, Cygwin is a unix emulation layer that runs on Windows and gives substantially unix-like environment. Architecturally, Cygwin is a port of glibc and the crt (the GNU tool chain's base libraries) as an adaptor on top of Win32. This emulation layer makes it easy to port unix/linux apps onto Cygwin. The platform comes with a pretty complete set of software - essentially a full linux distribution hosted on a Windows kernel. It allows you to work in a unix-like way on Windows without having to maintain a separate operating system installations. If you don't want to run VMs, multiple boots or multiple PCs it may be a way of easing into unix.
Ubuntu is nicely balanced, with a user friendly desktop but the potential to set up a fully functional programming environment.
I would advise experimenting with virtual machines - there is no reason to ditch your current setup until you've tried a few of the major distributions. VMware and others have a wide variety of server and desktop builds available.
I guess it also depends on what programming languages your are comfortable with.
If you worked with C# in the past then you could look at using the knowledge by running Mono , or maybe look at using Java (which is syntactically very similar). Either way Linux would be good.
I personally would recommend you look at the Mac's OS X. Its a unix BSD based OS, but with a really slick user interface over the top. To me it feels like the best of both the Windows and Unix worlds.
I do all my unix development on it, deploying onto Ubuntu servers. If you do look at a Mac, definitely take a look at the MacPorts project, which packages a large amount of the open source unix/linux software up making installation of programming tools incredibly easy.
Ubuntu seems to be very user-friendly, and has a lot of specific information for it in forums etc. So support-wise you'll be covered.
I experienced the shift from windows to ubuntu as very much do-able, things you can do graphically in windows can be done exactly the same in ubuntu (maybe some exceptions) and a bit more. A computer savvy individual should not have any problems.
However, it helps greatly if you are familiar with the basic shell commands (you'll need them as a programmer!). Some are the same as on windows but especially ls (dir) sometimes has me wracking my brain for "what was that command again", and vice versa when I'm back on windows.
Take some time to try them out. (for example: pwd, ls, mv, rm, ps, kill)
Finally, when installing programs often a simple "sudo apt-get install X " does all the work for you, even more user friendly than the windows installer executables I find.
Edit: You might want to try a VMware player and try a few linux distributions to play around in before you install the dual boot.
Get a macbook pro. OSX is the smoothest flavour of unix and the laptop should give you the push you need.
Then when you're feeling more confident, you can decide whether or not you want to spend most of your time configuring your soundcard, running ./autoconfigure && make, and debugging package manager screwups.
Any modern version of Unix (or Linux) you can get running on your machine will be fine.
Here are the ones that I would consider:
Ubuntu. As others have noted, this is often considered to be the easiest to use. However some parts are not "standard" Unix. For example, the startup scripts do not use init. This is mostly a good thing, but if you're trying to learn Unix may not be what you need.
Fedora. Bleeding edge but with rough edges.
Slackware. Possibly the most Unix-like Linux distribution (some would say dated!).
One of the *BSDs: FreeBSD, OpenBSD, NetBSD. Different approach to some things than Linux.
Solaris. This is "proper" Unix. Seems bare-bones compared with Linux but worth playing with to see what's "standard."
In fact, I would consider running at least a couple of them, most run fine as a VM. One of the good and bad things about Unix is that what's standardised is more the philosophy than many of the details. There's no Visual Studio, there's no C# (by that I mean no canonical high level language; I know about Mono).
Excellent answers. A few comments:
Almost all distros support LiveCDs, to let you try before installing. folks mentioned VMWare and VirtualBox, also note that Ubuntu's WUBI installer lets you install Linux under Windows without repartitioning; very nice; I used it when I first switched to my 64-bit system, since I wasn't sure how good the driver support was. Ubuntu 9.04 works great in 64, though. Also, since Ubuntu is so popular, that are many versions, Kubuntu uses KDE instead of Gnome, Mint and Xubuntu are both lighter weight.
Expect to run side-by-side for a while when transitioning from Windows. Cygwin has some nice downloadable manuals for people getting used to bash, and basic information about how *nix works underneath, targeted at Windows users. There are tons of useful sites; the Ubuntu community forums have a tremendous amount of information, for both beginners and advanced.
For getting used to developing under Linux, check the Linux documentation project. In addition to KDevelop, there's Anjuta, Eclipse, and many more. Some are light, some are heavyweight.
One thing that can ease the transition is to use software that runs in both operating systems. Firefox, Thunderbird, OpenOffice, Subversion, and hundreds if not thousands of others run fine in both Linux and Windows. And with very little effort, you can use the same folders for application settings and data for many of these. Firefox and Thunderbird can easily use the same folders/files on an NTFS partition. Makes dual booting much easier. Instructions are on the Ubuntu community site and other locations.
Note that some Linux software isn't NTFS friendly; in Linux keep your Subversion working folders on a native partition.
One caveat for sharing application settings; some applications store absolute paths; as a workaround, you can create symlinks that look like Windows drive letters.
After you get comfortable with Linux, branch out and try non-Windowsy applications and tools. Sometimes different is better. Lots of people use Emacs and Vim for good reasons.
Try Kubuntu as a distro and Kdevelop and Qt to start programming with, it's all very civilised.
Kate's an ok notepad-esque text editor if you want to go that way but I don't see why you'd want to get in to Vi or Emacs apart from the geeky appeal of using something really arcane.

Resources