Optimising Ubuntu For Mac
Optimizing Linux Performance on Hyper-V. Oracle, Ubuntu, SUSE and FreeBSD. In each of these sections you can find details on which Hyper-V features are supported in which Linux versions. Bottom line again, is that in this case, simply upgrading LIS to the current version of 4.1.3 delivered a 10% performance improvement. In this post, we will do an overview of some of the key optimization techniques that could help your to get the best performances of your WordPress site and your Linux VPS. The WordPress optimization techniques will be limited by the hosting service you are using. The standard Ubuntu desktop is so Mac-like that any Mac user will be able to navigate his or her way around the operating system and apps with ease. Sure, the “dock” is on the left side of the screen (see image below), but it’s very intuitive.
. These notes describe the installation of Ubuntu 14.04 on a Mac Mini. This is the most powerful server we have found for its size, especially considering that the PSU is internal. The recommended configuration of a workshop server is:. Quad-core i7 ('server' version). 16GB RAM. Two 250GB SSDs (e.g.
OCZ Vertex 4) These instructions have been tested on the following models:. Mid 2010 Core 2 (Macmini4,1). Mid 2011 i7 (Macmini5,3).
Mid 2013 i7 (Macmini6,2) When you have Linux running, you can determine your model using sudo dmidecode -s system-product-name For more information on the different models of Mac Mini see:. For installation only, you will need:. A mini-displayport to VGA adapter, or a HDMI cable. A monitor. A USB keyboard.
A 1GB+ USB flash drive or a USB CD-R drive We also recommend an Apple USB to Ethernet adapter for the external Internet connection. This leaves the internal gigabit Ethernet port available for the lab internal network and avoids having to trunk VLANs; it also helps if you have a newer Mac Mini where the internal ethernet adapter is not supported in the default kernel.
First you need to choose which ISO image to use and download it. Start with the standard 64-bit server edition (ubuntu-14.04-server-amd64.iso) which should work fine with recent Mac Minis. If you have problems booting, then try one of the amd64+mac variants from the page:. ubuntu-14.04-server-amd64+mac.iso. ubuntu-14.04-desktop-amd64+mac.iso You may burn the image onto a CD-R if you have a USB CD-ROM drive to boot from, such as the Apple Superdrive. To write the image to a USB stick you can simply dd it. To do this on a Mac running OSX: diskutil list # note the devices seen # insert flash drive diskutil list # note the new device seen, e.g.
/dev/disk2 diskutil unmountDisk /dev/diskN sudo dd if=ubuntu-14.04-server-amd64.iso of=/dev/rdiskN bs=1m diskutil eject /dev/diskN # remove flash drive To install older versions of Ubuntu you need to use a Mac which is running OSX and follow hdiutil convert -format UDRW -o ubuntu-12.04.3-server-amd64.img ubuntu-12.04.3-server-amd64.iso # Note: the output filename may be.img.dmg diskutil list # note the devices seen # insert flash drive diskutil list # note the new device seen, e.g. /dev/disk2 diskutil unmountDisk /dev/diskN sudo dd if=ubuntu-12.04.3-server-amd64.img.dmg of=/dev/rdiskN bs=1m diskutil eject /dev/diskN # remove flash drive Insert the CD-ROM or flash disk into the Mac Mini, and connect the keyboard and screen. Connect ethernet uplink - using the USB-to-ethernet adapter if you have one.
Power on and hold the alt/option key while it is starting. You may get a choice of boot icons - the USB key will be 'EFI boot'. After this you should get a menu of Ubuntu options: Install Ubuntu Server Install in expert mode Multiple server install with MAAS Check disc for defects Rescue a broken system Select 'Install Ubuntu Server' and proceed as normal, choosing country, language and keyboard layout. If you are using the USB-to-ethernet adapter for your external Internet connection, then you will be prompted for the primary network interface: eth0: Broadcom Corporation NetXtreme BCM57765 Gigabit Ethernet PCIe eth1: Ethernet Choose the one which is your ethernet uplink (i.e. Eth1). When you see 'Configuring network with DHCP' press ENTER to cancel.
Do this quickly!. Press 'Continue' on the Network autoconfiguration failed screen. Select 'Do not configure the network at this time'. Hostname: kit or whatever unique identifier for this setup.
Full name for the new user: NSRC instructor. Username: nsrc. (Use a suitable instructor password). Encrypt your home directory? No.
Select timezone. If you are going to be travelling around the world you should not accept the local timezone, and instead scroll down to 'UTC' at the very end of the worldwide list. Partition. If you see a screen that the install has detected a mounted partition select Yes to unmount the partition before continuing.
Partitioning:. Guided - use entire disk and set up LVM. 'Select disk to partition' SCSI1 (0,0,0) sda. 'Write changes to disk and configure LVM?' Yes.
Amount of volume group to use for guided partitioning: 50G (This will give about 31G root and 16G swap, but these are easy to grow later if required). The partitioning generated should look something like this: LVM VG hostname-vg, LV root as ext4 LVM VG hostname-vg, LV swap1 as swap partition #1 of SCSI1 (0,0,0) (sda) as EFIboot partition #2 of SCSI1 (0,0,0) (sda) as ext2 Write the changes to disks?. Use HTTP proxy? Check with your instructors whether there is a local cache you should use to speed up installation. If not, leave this blank, and packages will be fetched over the Internet. No automatic updates (you don't want changes in the middle of a workshop). Software to install: select only 'OpenSSH server'.
Use the space bar to toggle selections. Installation is complete: hit Enter, then unplug CD-ROM or USB stick when the screen goes black. Your Mac should be up and running - login as user nsrc. Use ifconfig -a to find its external IP address, and you should be able to ssh into it from outside. Then you no longer need the keyboard and monitor. Hint: also take a note of the MAC address of the USB-ethernet adapter, and label it. It helps when locating the machine without a monitor.
Since all the following commands need to be done as root, get a root shell: $ sudo -s # The second hard drive can now be made available for storing data. The simplest way to do this is to make the whole second drive an LVM physical volume, and add it to our volume group. First, check your current volume group name: # vgs Look under the first column 'VG': if it was created by the Ubuntu installer it will be something like ' -vg'. Label your second drive as a physical volume, and add it to the volume group: # pvcreate /dev/sdb # vgextend -vg /dev/sdb Now check your work: # pvs # should show both /dev/sda3 and /dev/sdb as physical volumes # vgs # The '#PV' (number of physical volumes) and VSize/VFree should increase Alternatively you could choose to partition it in the same way as the first drive, and it might be possible to boot off this drive if the first one fails - but you'd almost certainly have lost your OS installation anyway. Now let's create a new logical volume and mount it under /data. By creating a 'striped' volume, half of the extents will be on each disk; this increases performance by dividing the read and write load between the disks.
Optimising Ubuntu For Machine Learning
Choosing a large stripe size ensures that smaller reads and writes hit only a single disk. # lvcreate -size 300G -stripes 2 -stripesize 4096 -name data -vg # mkfs.ext4 -m 0 /dev/-vg/data # mkdir /data # vi /etc/fstab.
Add this line. /dev/-vg/data /data ext4 noatime 0 2 # mount /data # df -h To see which physical volume(s) each logical volume is using: # lvs -a -o +devices or # lvs -a -o name,lvsize,devices You can move the swap volume to the second disk, which helps balance the usage slightly. # pvmove -n swap1 /dev/sda3 /dev/sdb Optionally, you could also reduce its size. By default a 16GB RAM system will have a 16GB swap volume. If you don't intend to use hibernate functionality you can reduce it to (say) 4GB, as you never want your machine to go this far into swap anyway. # swapoff -a # lvresize -size 4G /dev/-vg/swap1 WARNING: Reducing active logical volume to 4.00 GiB THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce swap1? y/n: y Reducing logical volume swap1 to 4.00 GiB Logical volume swap1 successfully resized # mkswap /dev/-vg/swap1 Finally enable the swap partitions again # swapon -a # free # should have 4GB of swap space We purposely did not configure our network interfaces during installation so that the installation would go faster and we could configure out interfaces as we want now.
You can see that neither eth0 or eth1 are configured by doing: $ ifconfig To fix this, as root, at the command line prompt type: # vi /etc/network/interfaces Make sure the file looks like this: auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 10.10.0.241 netmask 255.255.255.0 auto eth1 iface eth1 inet dhcp Now to bring up both interfaces with their new configurations do: # ifup eth0 # ifup eth1 Wait a few seconds for the script to complete then type: # ifconfig to see that your network is now configured. Trying pinging some external sites to verify that your network is working. Now that our base operating system is installed we need to pull down a list of current versions of available packages and then download and install the packages.
Let's first see what version of the Linux kernel we are running: $ uname -a Remember this and see if you have a newer kernel version once we are finished with this exercise. To update apt and then packages that need updating do: # apt-get update # apt-get dist-upgrade Say 'Yes' to downloading and installing the new packages. This could take some time as a considerable amount of information is going to be downloaded. While this is happening we will go on to the next set of configuration items for your workshop kit which includes configuring your switch and access point. When your machine finishes with the apt-get update and the apt-get dist-upgrade processes you will likely have a new kernel image. This is one of the few times you need to reboot Linux to see change. To do this do: # reboot Wait for the MacMini to restart and log back in as the user nsrc, then type: $ uname -a To see the version of the Linux kernel that you are running.
Is it different from what you had before running 'apt-get update' and 'apt-get dist-upgrade'? At this point your MacMini is ready and in its initial state. We'll be updating your MacMini environment using a tool called Ansible a bit later. Assuming your network interfaces are properly configured you can now remove the monitor and keyboard attached to your MacMini and connect to it using ssh instead. By updating your /etc/hosts file to include the lab.nsrc.org domain your machine's public IP address will be registered on the public Internet using dynamic DNS. This will be configured using Ansible in our upcoming exercises.
In addition for class exercises and infrastructure your Mac Mini is referred to as 's1' or 's1.ws.nsrc.org'. We will add both these entries to your /etc/hosts file. The first two lines in your /etc/hosts file should look like: 127.0.0.1 localhost 127.0.1.1 kitX The 'X' is the number of your kit. We will now edit this file by doing: $ sudo vi /etc/hosts And change the first two lines to look like this: 127.0.0.1 localhost 10.10.0.241 kitX.lab.nsrc.org kitX s1.ws.nsrc.org s1 Be sure you substitue your kit's number for 'X'. Once done, save the file and exit.
If this is the first time you are installing Linux on your MacMini it's possible that the Linux installer will not set the boot order correctly. Your Mac may be set to boot Mac OS X, but this is no longer available. To correct this you need to do:. Connect a current Ubuntu version installation media, such as an Ubuntu 14.04 LTS USB disk.
Start your MacMini and hold down the option key until you see an option to boot as 'EFI Boot'. Select 'EFI Boot' and when presented with the Ubuntu Install screen select 'Rescue a broken system'.
You are now asked to run through the initial stages of the Ubuntu installation. Select keyboard, country, primary network interface (eth1), set hostname and time zone. Note that you can just use all defaults as none of these items will be saved.
When you see the screen for 'Device to use as root file system:' select /dev/s1-vg/root. When asked whether to mount the separate /boot partition, say Yes. Select 'Execute a shell in /dev/ -vg/root' and select 'Continue' At the bottom of your screen you will see the '#' command prompt. You are now in a rescue Linux shell where we can set some hardware options. You can type: efibootmgr You'll probably see MacOS X listed as the BootCurrent item (0080). We want the Ubuntu entry to become the BootCurrent item.
To do this type: efibootmgr -o 00 And, that's it. Type 'exit' to leave the rescue shell. Select 'Reboot the system' and remove the USB key. Your MacMini should now boot. It may pause for a moment with the white screen, but give it a few seconds to complete booting.
Optimising Ubuntu For Mac Free
If the attached monitor displays the grub prompt but then goes blank after booting, your monitor may not support the default resolution. If this happens, try booting with parameter 'nomodeset'. Hit any key at the grub menu to stop booting. Hit 'e' to edit.
Go to the end of the 'linux.' Line, and add nomodeset to the end. Hot seller etc-usb noise canceling mic for mac download. Ctrl-X or F10 to continue booting Then to make this change permanent: # vi /etc/default/grub GRUBCMDLINELINUXDEFAULT='nomodeset' # update-grub On the Internet there is for installing Ubuntu 12.04 on a Mac Mini 6,2. The author describes building the tg3 network driver from source and installing with the 'noapic' option. However we found we didn't have to do this. The following instructions were from previous tests with a Macmini4,1 and are kept in case they help debugging problems on older machines. It's probably safer to wipe out the existing Mac OS X and Linux partitions, which should also get rid of rEFIt.
That way we make sure that rEFIt is not changing how Linux views the system. Use Disk Utility to remove all partitions on both drives The image used successfully was the alternate-amd64+mac.iso image The problem is that this installs all the desktop GUI crap, which must be removed after installation. Boot from CD. Press F6 and select:. acpi=off. nomodeset. Continue as above, including same partitioning scheme.
Reboot # vi /etc/default/grub GRUBCMDLINELINUXDEFAULT='quiet' GRUBCMDLINELINUX=”noacpi nomodeset reboot=acpi” Disable lightdm (replacement for gdm): echo 'manual' sudo tee /etc/init/lightdm.override Then: # update-grub Remove all the desktop-related packages: # apt-get -purge remove 'gnome-.' xerver-xorg And install the right kernel: # apt-get install linux-headers-server linux-image-server linux-server All set. Aside: there may be another way to do this.
Speed up Ubuntu 17.04 in VirtualBox by Installing VirtualBox Guest Additions VirtualBox guest additions allows you to set up shared folders, enable bidirectional shared clipboard between host and guest, and power up the graphics ability of your guest machine. It’s a set of device drivers (graphics and mouse drivers) and system applications that is going to be installed in the guest OS. To install guest additions, first we need to install some tools for compiling kernel modules. In the Ubuntu virtual machine, run the following command to update existing software. Sudo apt update && sudo apt dist-upgrade Please note that if a new kernel is installed, you need to reboot Ubuntu. Then install required packages for building kernel modules.
Sudo apt install build-essential module-assistant dkms Next, prepare your system to build kernel module. Sudo m-a prepare Output: In VirtualBox menu bar, select Devices Insert Guest Additions CD image.
You might be asked to download the guest additions CD image if it cannot be found on your hard drive. Click Download. Once the download is complete, click Insert button to insert the CD image into the virtual optical drive.
If the guest additions CD image had already been downloaded before, then you will be asked to run the software contained in it, click Run button. Then enter your password and it will begin compiling the VirtualBox guest additions kernel modules. You may be notified that your system already have a version of the VirtualBox Guest Additions, but built-in version is of low quality. So enter yes to continue. Once the guest additions is installed, press Enter to close the terminal window and shut down your Ubuntu virtual machine. (Don’t reboot it now.) Go to your VirtualBox settings.
Click Display on the left pane. In the Screen tab, allocate 128M video memory to Ubuntu VM and make sure Enable 3D Acceleration is checked.
Save you settings. Start Ubuntu virtual machine.
It should be running much faster now because Unity 3D is supported with the new graphics driver. Run the following command in a terminal window. /usr/lib/nux/unitysupporttest -p You will see that Unity 3D is supported. Other Tips to Speed up Ubuntu in VirtualBox You can also check out, which also goes for Ubuntu virtual machine.