This morning, I finally broke down and installed Ubuntu 15.10 into Virtual Box. I didn’t take notes, which I am now kicking myself for because it didn’t occur to me until after I had gone through the entire annoyingly tweaky process.
Here are the highlights.
First, I installed Virtual Box. I mostly went with the directions in this Simple Help write-up. The directions are 15.04, but they worked fine for 15.10. Per the write-up, I went with all the defaults. It took an hour or more for the Ubuntu install to get itself set-up. Prepare to head out for a few errands.
Next, I spent time familiarizing myself with Ubuntu, finding the terminal, chsh’ing to tcsh from bash (I had to apt-get tcsh) and setting up my .cshrc. I also installed lns (bless it) and downloaded the latest 15.10 Swift 2.2 snapshot from swift.org.
Then I symbolic linked swift and swiftc into my ~/bin folder, checked that I could run them both from wherever, and then set to working on getting ssh running so I didn’t have to use Virtual Box directly.
To do that, first I had to apt-get install OpenSSH-server, which was no big deal, and then what took the most time was figuring out how to set up networking. Turns out that you need to shut down the machine, set up Adapter 1 to use Bridged Adapter (thanks aciidb) and the find the 10.0.whatever-ip-address using if-config after rebooting. (Mine was 10.0.0.35).
Once I got past that, I was able to ssh in over from my Mac and start using Swift. I began with a simple shell script (thought that was easier) and then moved onto
swift and then
As Mike Ash pointed out, when encouraging me to use ssh with Virtual Box, you gain all the utility of your normal terminal session including copy, paste, etc without having to deal with mouse capture, etc.
Extremely interesting! I’ve been wondering how Swift was working out on Linux. Never heard of Virtual Box before, but may try it out in the New Year. Bookmarking!
Now that you have VirtualBox, take a look at https://github.com/swiftdocker/docker-swift Homebrew has the Docker toolbox.
Docker containers let you avoid having to remember how to configure your Ubuntu install. 🙂
Unless your goal was to become familiar with the installation process, an easier (IMO) alternative is to use Vagrant (https://www.vagrantup.com/).
If you intend to interact with your VM only via SSH, you might want to look into Vagrant, which would simplify performing the setup steps.