Ubuntu Pastebin

Paste from zyga at Wed, 6 Dec 2017 13:11:09 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Define UBUNTU_SSO_NAME to your UNIX username on login.ubuntu.com.
UBUNTU_SSO_NAME?=$(error set UBUNTU_SSO_NAME to your username on login.ubuntu.com)

# Boot our working image and redirect SSH and HTTP ports to localhost.
.PHONY: boot
boot: ubuntu-core-16-amd64.img
	kvm -smp 2 -m 1500 -netdev user,id=mynet0,hostfwd=tcp::8022-:22,hostfwd=tcp::8090-:80 -device virtio-net-pci,netdev=mynet0 -vga qxl -drive file=ubuntu-core-16-amd64.img,format=raw

# Login into our booted image. Run after running boot from another terminal.
.PHONY: login
login:
	ssh -p 8022 $(UBUNTU_SSO_NAME)@localhost

# Uncompress the vanilla image into our working image.
ubuntu-core-16-amd64.img: ubuntu-core-16-amd64.img.xz
	unxz --keep ubuntu-core-16-amd64.img.xz

# Download the compressed, vanilla image.
.PRECIOUS: ubuntu-core-16-amd64.img.xz
ubuntu-core-16-amd64.img.xz:
	wget http://cdimage.ubuntu.com/ubuntu-core/16/stable/current/ubuntu-core-16-amd64.img.xz
Download as text