-
-
Save cieplak/aac5bf6330d4b90eebfab1ef09c78d65 to your computer and use it in GitHub Desktop.
Revisions
-
Tomonori Tanabe revised this gist
Sep 28, 2015 . 1 changed file with 2 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,9 +46,9 @@ Before using xhyve, run the vm on qemu. $ qemu-system-x86_64 -m 256 -hda fbsd.raw ``` For VirtIO, Edit /etc/fstab. ``` # Device Mountpoint FStype Options Dump Pass# /dev/ada0p2 / ufs rw 1 1 @@ -61,8 +61,6 @@ To /dev/vtbd0p3 none swap sw 0 0 ``` Edit /etc/rc.conf ``` ifconfig_vtnet0="DHCP" -
Tomonori Tanabe revised this gist
Sep 27, 2015 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ $ brew install xhyve --HEAD This turorial creates 5G image. ``` $ cd /path/to/workdir $ mkfile 5g fbsd.img ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ $ brew install qemu - This Example creates 10GB image. ``` $ cd /path/to/workdir $ qemu-img create -f raw fbsd.raw 10G Formatting 'fbsd.raw', fmt=raw size=10737418240 $ ls -
Tomonori Tanabe revised this gist
Sep 27, 2015 . 2 changed files with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,7 +32,7 @@ FreeBSD-10.2-RELEASE-amd64-bootonly.iso fbsd.img ``` #!/bin/sh UUID="-U deaddead-dead-dead-dead-deaddeaddead" USERBOOT="/Library/Caches/Homebrew/xhyve--git/test/userboot.so" BOOTVOLUME="FreeBSD-10.2-RELEASE-amd64-bootonly.iso" @@ -63,7 +63,7 @@ $ sudo xhyverun-fbsdinstall.sh ``` #!/bin/sh UUID="-U deaddead-dead-dead-dead-deaddeaddead" USERBOOT="/Library/Caches/Homebrew/xhyve--git/test/userboot.so" BOOTVOLUME="fbsd.img" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -75,7 +75,7 @@ Create running script(xhyverun-fbsd.sh). ``` #!/bin/sh UUID="-U deaddead-dead-dead-dead-deaddeaddead" USERBOOT="/Library/Caches/Homebrew/xhyve--git/test/userboot.so" BOOTVOLUME="fbsd.raw" -
Tomonori Tanabe revised this gist
Sep 27, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,7 +40,7 @@ QEMU window will open. Install FreeBSD. # Run The VM On Xhyve ## #1 Before using xhyve, run the vm on qemu. ``` $ qemu-system-x86_64 -m 256 -hda fbsd.raw -
Tomonori Tanabe revised this gist
Sep 27, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ $ brew install xhyve --HEAD # Create Guest Image This turorial creates 5G image. ``` $ cd /PATH/TO/WORKDIR $ mkfile 5g fbsd.img -
Tomonori Tanabe revised this gist
Sep 27, 2015 . 1 changed file with 6 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -75,20 +75,21 @@ Create running script(xhyverun-fbsd.sh). ``` #!/bin/sh UUID="-U 0e18f1be-e59c-461e-87b9-4f4b865a4efb" USERBOOT="/Library/Caches/Homebrew/xhyve--git/test/userboot.so" BOOTVOLUME="fbsd.raw" KERNELENV="" MEM="-m 2G" SMP="-c 2" PCI_DEV="-s 0:0,hostbridge -s 31,lpc" NET="-s 2:0,virtio-net" IMG_HDD="-s 4:0,virtio-blk,$BOOTVOLUME" LPC_DEV="-l com1,stdio" ACPI="-A" xhyve $ACPI $MEM $SMP $PCI_DEV $LPC_DEV $NET $IMG_HDD $UUID -f fbsd,$USERBOOT,$BOOTVOLUME,"$KERNELENV" ``` Run the FreeBSD VM. -
Tomonori Tanabe revised this gist
Sep 27, 2015 . No changes.There are no files selected for viewing
-
Tomonori Tanabe renamed this gist
Sep 27, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Tomonori Tanabe revised this gist
Sep 27, 2015 . 2 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes. -
Tomonori Tanabe renamed this gist
Sep 27, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Tomonori Tanabe revised this gist
Sep 27, 2015 . No changes.There are no files selected for viewing
-
Tomonori Tanabe revised this gist
Sep 27, 2015 . 2 changed files with 214 additions and 92 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,146 +1,122 @@ # TL;DR - Create 5GB FreeBSD image. - Install FreeBSD on xhyve. - Mount host directory. # Requisites - OSX - [Homebrew](http://brew.sh) - [xhyve](https://github.com/mist64/xhyve) ``` $ brew install xhyve --HEAD ``` # Create Guest Image This turorial creates 5g image. ``` $ cd /PATH/TO/WORKDIR $ mkfile 5g fbsd.img ``` # Install FreeBSD - Donwload FreeBSD installer(FreeBSD-10.2-RELEASE-amd64-bootonly.iso) from [freebsd.org](https://www.freebsd.org/where.html). ``` $ ls FreeBSD-10.2-RELEASE-amd64-bootonly.iso fbsd.img ``` - Create install script (xhyverun-fbsdinstall.sh) ``` #!/bin/sh UUID="-U 0e18f1be-e59c-461e-87b9-4f4b865a4efb" USERBOOT="/Library/Caches/Homebrew/xhyve--git/test/userboot.so" BOOTVOLUME="FreeBSD-10.2-RELEASE-amd64-bootonly.iso" IMG="fbsd.img" KERNELENV="" MEM="-m 2G" SMP="-c 2" PCI_DEV="-s 0:0,hostbridge -s 31,lpc" NET="-s 2:0,virtio-net" IMG_CD="-s 3:0,ahci-cd,FreeBSD-10.2-RELEASE-amd64-bootonly.iso" IMG_HDD="-s 4:0,virtio-blk,$IMG" LPC_DEV="-l com1,stdio" ACPI="-A" xhyve $ACPI $MEM $SMP $PCI_DEV $LPC_DEV $NET $IMG_CD $IMG_HDD $UUID -f fbsd,$USERBOOT,$BOOTVOLUME,"$KERNELENV" ``` - Run ``` $ sudo xhyverun-fbsdinstall.sh ``` # Run The FreeBSD Guest - Create run script(xhyverun-fbsd.sh). ``` #!/bin/sh UUID="-U 0e18f1be-e59c-461e-87b9-4f4b865a4efb" USERBOOT="/Library/Caches/Homebrew/xhyve--git/test/userboot.so" BOOTVOLUME="fbsd.img" KERNELENV="" MEM="-m 2G" SMP="-c 2" PCI_DEV="-s 0:0,hostbridge -s 31,lpc" NET="-s 2:0,virtio-net" IMG_HDD="-s 4:0,virtio-blk,$BOOTVOLUME" LPC_DEV="-l com1,stdio" ACPI="-A" xhyve $ACPI $MEM $SMP $PCI_DEV $LPC_DEV $NET $IMG_HDD $UUID -f fbsd,$USERBOOT,$BOOTVOLUME,"$KERNELENV" ``` - Run ``` $ sudo xhyverun-fbsd.sh ``` # Mount Host Directory - Referenece [mist64/xhyve/issues/45](https://github.com/mist64/xhyve/issues/45) ### On host(192.168.64.1) ``` $ sudo touch /etc/exports $ sudo emacs /etc/exports ``` Edit /etc/exports ([exports(5)](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/exports.5.html)) ``` /PATH/TO/EXPORTDIR -mapall=501 -network 192.168.64.0 -mask 255.255.255.0 ``` Reread file ([nfsd(8)](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/nfsd.8.html)) ``` $ sudo nfsd update ``` ### On virtual machine Mount ``` # mkdir /usr/home/YOU/host-shared # sudo mount 192.168.64.1:/PATH/TO/EXPORTDIR /usr/home/YOU/host-shared ``` Unmount ``` # mount /dev/vtbd0p2 on / (ufs, local, journaled soft-updates) devfs on /dev (devfs, local, multilabel) 192.168.64.1:/PATH/TO/EXPORTDIR on /usr/home/YOU/host-shared (nfs) # sudo umount 192.168.64.1:/PATH/TO/EXPORTDIR ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,146 @@ # TL;DR - Create 10GB FreeBSD image using QEMU. - Run the VM on xhyve. # Requisites - OS X - [Homebrew](http://brew.sh) - [xhyve](https://github.com/mist64/xhyve) ``` $ brew install xhyve --HEAD ``` - [QEMU](http://www.qemu.org) ``` $ brew install qemu ``` # Create Virtual Machine - This Example creates 10GB image. ``` $ cd /Path/to/workdir $ qemu-img create -f raw fbsd.raw 10G Formatting 'fbsd.raw', fmt=raw size=10737418240 $ ls FreeBSD-10.2-RELEASE-amd64-bootonly.iso fbsd.raw ``` # Install FreeBSD - Download FreeBSD installer image(FreeBSD-10.2-RELEASE-amd64-bootonly.iso) from [freebsd.org](https://www.freebsd.org/where.html). ``` $ qemu-system-x86_64 -m 256 -hda fbsd.raw -cdrom FreeBSD-10.2-RELEASE-amd64-bootonly.iso WARNING: Image format was not specified for 'fbsd.raw' and probing guessed raw. Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. ``` QEMU window will open. Install FreeBSD. # Run The VM On Xhyve ## #1 Before using xhyve, run the vm onu qemu. ``` $ qemu-system-x86_64 -m 256 -hda fbsd.raw ``` Change GEOM name 'ada0' to 'vtbd0'. Edit /etc/fstab, ``` # Device Mountpoint FStype Options Dump Pass# /dev/ada0p2 / ufs rw 1 1 /dev/ada0p3 none swap sw 0 0 ``` To ``` # Device Mountpoint FStype Options Dump Pass# /dev/vtbd0p2 / ufs rw 1 1 /dev/vtbd0p3 none swap sw 0 0 ``` And set DHCP to vtnet0 interface. Edit /etc/rc.conf ``` ifconfig_vtnet0="DHCP" ``` Shut it down and close the qemu window. ## #2 Create running script(xhyverun-fbsd.sh). ``` #!/bin/sh USERBOOT="/Library/Caches/Homebrew/xhyve--git/test/userboot.so" BOOTVOLUME="fbsd.raw" KERNELENV="" MEM="-m 2G" SMP="-c 2" IMG_HDD="-s 4:0,virtio-blk,$BOOTVOLUME" PCI_DEV="-s 0:0,hostbridge -s 31,lpc" LPC_DEV="-l com1,stdio" NET="-s 2:0,virtio-net" # UUID="-U deaddead-dead-dead-dead-deaddeaddead" xhyve -A $MEM $SMP $PCI_DEV $LPC_DEV $NET $IMG_CD $IMG_HDD $UUID -f fbsd,$USERBOOT,$BOOTVOLUME,"$KERNELENV" ``` Run the FreeBSD VM. ``` $ sudo xhyverun-fbsd.sh ______ ____ _____ _____ | ____| | _ \ / ____| __ \ | |___ _ __ ___ ___ | |_) | (___ | | | | | ___| '__/ _ \/ _ \| _ < \___ \| | | | | | | | | __/ __/| |_) |____) | |__| | | | | | | | || | | | |_| |_| \___|\___||____/|_____/|_____/ ``` ` s` `.....---.......--.``` -/ +============Welcome to FreeBSD===========+ +o .--` /y:` +. | | yo`:. :o `+- ``` If you got following mount error, you may be forgeting #1. ``` Trying to mount root from ufs:/dev/ada0p2 [rw]... mountroot: waiting for device /dev/ada0p2 ... Mounting from ufs:/dev/ada0p2 failed with error 19. Loader variables: vfs.root.mountfrom=ufs:/dev/ada0p2 vfs.root.mountfrom.options=rw Manual root filesystem specification: <fstype>:<device> [options] Mount <device> using filesystem <fstype> and with the specified (optional) option list. eg. ufs:/dev/da0s1a zfs:tank cd9660:/dev/acd0 ro (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /) ? List valid disk boot devices . Yield 1 second (for background tasks) <empty line> Abort manual input mountroot> ``` But you can mount device manually. ``` mountroot> ? List of GEOM managed disk devices: gptid/5bebeba9-6364-11e5-abe5-bd56998f3bd1 gptid/5be6a257-6364-11e5-abe5-bd56998f3bd1 ufsid/56050e05aac93398 gptid/5be40c9f-6364-11e5-abe5-bd56998f3bd1 diskid/DISK-BHYVE-1C5B-53F3-EA71p3 diskid/DISK-BHYVE-1C5B-53F3-EA71p2 diskid/DISK-BHYVE-1C5B-53F3-EA71p1 vtbd0p3 vtbd0p2 vtbd0p1 diskid/DISK-BHYVE-1C5B-53F3-EA71 vtbd0 mountroot> ufs:ufsid/56050e05aac93398 ``` -
Tomonori Tanabe revised this gist
Sep 27, 2015 . 2 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes. -
Tomonori Tanabe revised this gist
Sep 27, 2015 . 2 changed files with 10 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,13 @@ # TL;DR - Resize vm image using qemu-img. # Requisites - OS X - [Homebrew](http://brew.sh) - [xhyve](https://github.com/mist64/xhyve) ``` $ brew install xhyve --HEAD ``` - [QEMU](http://www.qemu.org) ``` $ brew install qemu This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -71,9 +71,7 @@ ifconfig_vtnet0="DHCP" Shut it down and close the qemu window. ## #2 Create running script(xhyverun-fbsd.sh). ``` #!/bin/sh @@ -95,7 +93,7 @@ xhyve -A $MEM $SMP $PCI_DEV $LPC_DEV $NET $IMG_CD $IMG_HDD $UUID -f fbsd,$USERBO Run the FreeBSD VM. ``` $ sudo xhyverun-fbsd.sh ______ ____ _____ _____ | ____| | _ \ / ____| __ \ -
Tomonori Tanabe revised this gist
Sep 27, 2015 . 2 changed files with 92 additions and 124 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,88 @@ # Requisites - OS X - [QEMU](http://www.qemu.org) ``` $ brew install qemu ``` # Resizing And Growing Disks - Reference [freebsd.org/doc/handbook/disks-growing](https://www.freebsd.org/doc/handbook/disks-growing.html) Resize VM image size on Host. This example 10GB -> 15GB. ``` $ qemu-img resize fbsd.raw 15GB ``` Fix disk partitions configuration on the VM. ``` # gpart show => 34 20971453 vtbd0 GPT (15G) [CORRUPT] 34 1024 1 freebsd-boot (512K) 1058 19919872 2 freebsd-ufs (9.5G) 19920930 1048576 3 freebsd-swap (512M) 20969506 1981 - free - (991K) # gpart recover vtbd0 vtbd0 recovered # gpart show => 34 31457213 vtbd0 GPT (15G) 34 1024 1 freebsd-boot (512K) 1058 19919872 2 freebsd-ufs (9.5G) 19920930 1048576 3 freebsd-swap (512M) 20969506 10487741 - free - (5.0G) ``` Delete swap partition. ``` # swapoff /dev/vtbd0p3 # gpart delete -i 3 vtbd0 vtbd0p3 deleted # gpart show => 34 31457213 vtbd0 GPT (15G) 34 1024 1 freebsd-boot (512K) 1058 19919872 2 freebsd-ufs (9.5G) 19920930 11536317 - free - (5.5G) ``` Resize freebsd-ufs partition. ``` # gpart resize -i 2 -a 4k -s 14G vtbd0 vtbd0p2 resized root@xhyve-freebsd:~ # gpart show => 34 31457213 vtbd0 GPT (15G) 34 1024 1 freebsd-boot (512K) 1058 29360126 2 freebsd-ufs (14G) 29361184 2096063 - free - (1.0G) ``` Recreate swap partition. ``` # gpart add -t freebsd-swap -a 4k -s 512M vtbd0 vtbd0p3 added # gpart show => 34 31457213 vtbd0 GPT (15G) 34 1024 1 freebsd-boot (512K) 1058 29360126 2 freebsd-ufs (14G) 29361184 1048576 3 freebsd-swap (512M) 30409760 1047487 - free - (511M) # swapon /dev/vtbd0p3 ``` Grow the UFS file system. ``` # growfs /dev/vtbd0p2 Device is mounted read-write; resizing will result in temporary write suspension for /. It's strongly recommended to make a backup before growing the file system. OK to grow filesystem on /dev/vtbd0p2, mounted on /, from 9.5GB to 14GB? [Yes/No] Yes super-block backups (for fsck_ffs -b #) at: 20516032, 21798272, 23080512, 24362752, 25644992, 26927232, 28209472 ``` Check the resized file system. ``` # df -h Filesystem Size Used Avail Capacity Mounted on /dev/vtbd0p2 14G 1.9G 11G 16% / devfs 1.0K 1.0K 0B 100% /dev ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,9 @@ # TL;DR - Create 10GB FreeBSD image using QEMU. - Run the VM on xhyve. # Requisites - OS X - [Homebrew](http://brew.sh) - [xhyve](https://github.com/mist64/xhyve) ``` @@ -16,7 +13,6 @@ $ brew install xhyve --HEAD ``` $ brew install qemu ``` # Create Virtual Machine @@ -30,6 +26,9 @@ FreeBSD-10.2-RELEASE-amd64-bootonly.iso fbsd.raw ``` # Install FreeBSD - Download FreeBSD installer image(FreeBSD-10.2-RELEASE-amd64-bootonly.iso) from [freebsd.org](https://www.freebsd.org/where.html). ``` $ qemu-system-x86_64 -m 256 -hda fbsd.raw -cdrom FreeBSD-10.2-RELEASE-amd64-bootonly.iso WARNING: Image format was not specified for 'fbsd.raw' and probing guessed raw. @@ -147,122 +146,3 @@ List of GEOM managed disk devices: mountroot> ufs:ufsid/56050e05aac93398 ``` -
Tomonori Tanabe renamed this gist
Sep 27, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Tomonori Tanabe revised this gist
Sep 27, 2015 . 1 changed file with 9 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,16 +23,16 @@ $ brew install qemu - This Example creates 10GB image. ``` $ cd /Path/to/workdir $ qemu-img create -f raw fbsd.raw 10G Formatting 'fbsd.raw', fmt=raw size=10737418240 $ ls FreeBSD-10.2-RELEASE-amd64-bootonly.iso fbsd.raw ``` # Install FreeBSD ``` $ qemu-system-x86_64 -m 256 -hda fbsd.raw -cdrom FreeBSD-10.2-RELEASE-amd64-bootonly.iso WARNING: Image format was not specified for 'fbsd.raw' and probing guessed raw. Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. ``` @@ -44,7 +44,7 @@ QEMU window will open. Install FreeBSD. Before using xhyve, run the vm onu qemu. ``` $ qemu-system-x86_64 -m 256 -hda fbsd.raw ``` Change GEOM name 'ada0' to 'vtbd0'. @@ -79,7 +79,7 @@ xhyverun-freebsd.sh #!/bin/sh USERBOOT="/Library/Caches/Homebrew/xhyve--git/test/userboot.so" BOOTVOLUME="fbsd.raw" KERNELENV="" MEM="-m 2G" @@ -190,7 +190,7 @@ devfs on /dev (devfs, local, multilabel) Resize VM image size on Host. This example 10GB -> 15GB. ``` $ qemu-img resize fbsd.raw 15GB ``` Fix disk partitions configuration on the VM. @@ -265,8 +265,4 @@ Check the resized file system. Filesystem Size Used Avail Capacity Mounted on /dev/vtbd0p2 14G 1.9G 11G 16% / devfs 1.0K 1.0K 0B 100% /dev ``` -
Tomonori Tanabe revised this gist
Sep 26, 2015 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -188,12 +188,12 @@ devfs on /dev (devfs, local, multilabel) # Resizing And Growing Disks - Reference [freebsd.org/doc/handbook/disks-growing](https://www.freebsd.org/doc/handbook/disks-growing.html) Resize VM image size on Host. This example 10GB -> 15GB. ``` $ qemu-img resize VM10G.raw 15GB ``` Fix disk partitions configuration on the VM. ``` # gpart show => 34 20971453 vtbd0 GPT (15G) [CORRUPT] @@ -212,7 +212,7 @@ vtbd0 recovered 20969506 10487741 - free - (5.0G) ``` Delete swap partition. ``` # swapoff /dev/vtbd0p3 # gpart delete -i 3 vtbd0 @@ -224,7 +224,7 @@ vtbd0p3 deleted 19920930 11536317 - free - (5.5G) ``` Resize freebsd-ufs partition. ``` # gpart resize -i 2 -a 4k -s 14G vtbd0 vtbd0p2 resized @@ -235,7 +235,7 @@ root@xhyve-freebsd:~ # gpart show 29361184 2096063 - free - (1.0G) ``` Recreate swap partition. ``` # gpart add -t freebsd-swap -a 4k -s 512M vtbd0 vtbd0p3 added @@ -249,7 +249,7 @@ vtbd0p3 added # swapon /dev/vtbd0p3 ``` Grow the UFS file system. ``` # growfs /dev/vtbd0p2 Device is mounted read-write; resizing will result in temporary write suspension for /. -
Tomonori Tanabe revised this gist
Sep 26, 2015 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,7 +38,7 @@ WARNING: Image format was not specified for 'VM10G.raw' and probing guessed raw. ``` QEMU window will open. Install FreeBSD. # Run The VM On Xhyve ## #1 Before using xhyve, run the vm onu qemu. @@ -152,7 +152,7 @@ mountroot> ufs:ufsid/56050e05aac93398 # Mount Host Directory - Referenece [mist64/xhyve/issues/45](https://github.com/mist64/xhyve/issues/45) ### On host(192.168.64.1) ``` $ sudo touch /etc/exports $ sudo emacs /etc/exports @@ -168,7 +168,7 @@ Reread file ([nfsd(8)](https://developer.apple.com/library/mac/documentation/Dar $ sudo nfsd update ``` ### On virtual machine Mount ``` # mkdir /usr/home/YOU/host-shared @@ -185,7 +185,7 @@ devfs on /dev (devfs, local, multilabel) ``` # Resizing And Growing Disks - Reference [freebsd.org/doc/handbook/disks-growing](https://www.freebsd.org/doc/handbook/disks-growing.html) Resize VM size on Host. This example 10GB -> 15GB. -
Tomonori Tanabe revised this gist
Sep 26, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # TL;DR - Create 10GB FreeBSD image using QEMU. - Run the VM on xhyve. - Mount host directory. - Resize the image. @@ -38,10 +38,10 @@ WARNING: Image format was not specified for 'VM10G.raw' and probing guessed raw. ``` QEMU window will open. Install FreeBSD. # Run The VM on xhyve ## #1 Before using xhyve, run the vm onu qemu. ``` $ qemu-system-x86_64 -m 256 -hda VM10G.raw -
Tomonori Tanabe revised this gist
Sep 26, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ $ brew install xhyve --HEAD ``` $ brew install qemu ``` - FreeBSD installer image(FreeBSD-10.2-RELEASE-amd64-bootonly.iso). Download from [freebsd.org](https://www.freebsd.org/where.html) # Create Virtual Machine -
Tomonori Tanabe revised this gist
Sep 25, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ $ brew install xhyve --HEAD ``` $ brew install qemu ``` - FreeBSD installer. Download from [freebsd.org](https://www.freebsd.org/where.html) # Create Virtual Machine @@ -150,7 +150,7 @@ mountroot> ufs:ufsid/56050e05aac93398 # Mount Host Directory - Referenece [mist64/xhyve/issues/45](https://github.com/mist64/xhyve/issues/45) ### On Host(192.168.64.1) ``` @@ -186,7 +186,7 @@ devfs on /dev (devfs, local, multilabel) # Resizing and Growing Disks - Reference [freebsd.org/doc/handbook/disks-growing](https://www.freebsd.org/doc/handbook/disks-growing.html) Resize VM size on Host. This example 10GB -> 15GB. ``` -
Tomonori Tanabe revised this gist
Sep 25, 2015 . 1 changed file with 0 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -98,7 +98,6 @@ Run the FreeBSD VM. ``` $ sudo xhyverun-freebsd.sh ______ ____ _____ _____ | ____| | _ \ / ____| __ \ | |___ _ __ ___ ___ | |_) | (___ | | | | @@ -109,18 +108,6 @@ ______ ____ _____ _____ s` `.....---.......--.``` -/ +============Welcome to FreeBSD===========+ +o .--` /y:` +. | | yo`:. :o `+- ``` -
Tomonori Tanabe revised this gist
Sep 25, 2015 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -171,9 +171,14 @@ $ sudo touch /etc/exports $ sudo emacs /etc/exports ``` Edit /etc/exports ([exports(5)](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/exports.5.html)) ``` /PATH/TO/EXPORTDIR -mapall=501 -network 192.168.64.0 -mask 255.255.255.0 ``` Reread file ([nfsd(8)](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/nfsd.8.html)) ``` $ sudo nfsd update ``` ### On VM -
Tomonori Tanabe revised this gist
Sep 25, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -276,4 +276,5 @@ devfs 1.0K 1.0K 0B 100% /dev ``` Now's the time to rename VM10G.raw. It is no longer 10GB... Hahaha. -
Tomonori Tanabe revised this gist
Sep 25, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -275,4 +275,5 @@ Filesystem Size Used Avail Capacity Mounted on devfs 1.0K 1.0K 0B 100% /dev ``` Now's the time to rename VM10G.raw. It's not 10GB... Hahaha. -
Tomonori Tanabe revised this gist
Sep 25, 2015 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,8 @@ # TL;DR - Create 10GB FreeBSD image using QEMU. - Run the VM using xhyve. - Mount host directory. - Resize the image. # Requisites -
Tomonori Tanabe revised this gist
Sep 25, 2015 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,8 @@ # TL;DR - Create 10GB FreeBSD Image - Mount host directory - Resize virtual machine image # Requisites - OSX -
Tomonori Tanabe revised this gist
Sep 25, 2015 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,11 +4,11 @@ - [Homebrew](http://brew.sh) - [xhyve](https://github.com/mist64/xhyve) ``` $ brew install xhyve --HEAD ``` - [QEMU](http://www.qemu.org) ``` $ brew install qemu ``` - FreeBSD installer. Download from https://www.freebsd.org/where.html @@ -173,17 +173,17 @@ Edit /etc/exports ### On VM Mount ``` # mkdir /usr/home/YOU/host-shared # sudo mount 192.168.64.1:/PATH/TO/EXPORTDIR /usr/home/YOU/host-shared ``` Unmount ``` # mount /dev/vtbd0p2 on / (ufs, local, journaled soft-updates) devfs on /dev (devfs, local, multilabel) 192.168.64.1:/PATH/TO/EXPORTDIR on /usr/home/YOU/host-shared (nfs) # sudo umount 192.168.64.1:/PATH/TO/EXPORTDIR ``` @@ -192,10 +192,10 @@ $ sudo umount 192.168.64.1:/PATH/TO/EXPORTDIR Resize VM size on Host. This example 10GB -> 15GB. ``` $ qemu-img resize VM10G.raw 15GB ``` Fix disk partitions configuration on VM ``` # gpart show => 34 20971453 vtbd0 GPT (15G) [CORRUPT] @@ -269,4 +269,4 @@ Filesystem Size Used Avail Capacity Mounted on devfs 1.0K 1.0K 0B 100% /dev ``` Now is the time to rename VM10G.raw which is not 10GB image. Hahaha. -
Tomonori Tanabe revised this gist
Sep 25, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -190,7 +190,7 @@ $ sudo umount 192.168.64.1:/PATH/TO/EXPORTDIR # Resizing and Growing Disks - Reference https://www.freebsd.org/doc/handbook/disks-growing.html Resize VM size on Host. This example 10GB -> 15GB. ``` qemu-img resize VM10G.raw 15GB ```
NewerOlder