แสดงบทความที่มีป้ายกำกับ solved แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ solved แสดงบทความทั้งหมด

วันอังคาร, มกราคม 27, 2558

แก้ปัญหาสร้าง base box ไม่ได้ ด้วย vagrant 1.7.1 บน OSX Yosemite (Workaround)

บันทึก แก้ปัญหา vagrant 1.7.1 บน OSX Yosemite สร้าง vagrant base box ไม่ได้

พอ execute คำสั่งแบบนี้

$ vagrant package --basebox trusty64 

เจอ errror keyword แบบนี้ wrong number of arguments (2 for 1) (ArgumentError)

/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/machine.rb:153:in `action': wrong number of arguments (2 for 1) (ArgumentError)
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:83:in `package_vm'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:66:in `package_base'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/environment.rb:301:in `cli'
    from /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.1/bin/vagrant:174:in `<main>'

    ตามไปดูที่ github ของ vagrant ณ วันที่เขียนนี้ยังไม่ได้ release ตัวแก้ที่ใช้ได้จริงออกมา, ใช้  vagrant 1.7.2 ก็ยังใช้ไม่ได้นะ

workaround ตอนนี้คือให้ไปแก้ไขไฟล์นี้
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb

ใช้ vi แล้วแก้ไข ที่เพิ่มขึ้นมาคือ code ส่วน สีน้ำเงิน

$ sudo vi /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb

 79           acc["package.#{k}".to_sym] = v
 80           acc
 81         end
 82
 83         vm.action(:package, **opts)

คราวนี้เรียกคำสั่งเพื่อทำการ pack box file ได้แล้ว ไม่มี error อีก

Workaround fixed from github: https://github.com/mitchellh/vagrant/issues/4962

วันพฤหัสบดี, ธันวาคม 26, 2556

OSX: Solution: Virtualbox 4.x bridged network not working on OSX 10.9 Mavericks

Thai: แก้ปัญหา Virtualbox 4.2, 4.3 ใช้ bridged network บน OSX 10.9 ไม่ได้ 

    I'm using Virtualbox 4.2, 4.3 with OSX 10.9 the bridged network not working. The error message look like this 
'HostInterfaceNetworking-en0' (VERR_SUPDRV_COMPONENT_NOT_FOUND). 

    I'm googled, someone said if we uninstall and re-install it the problem will gone, but it's not working for me, after several reboot the problem still arise. 

    So, this is another solution. By using this script before start the Virtualbox would help/solve the problem :) 

#!/bin/bash
 
unload() {
  sudo ifconfig bridge0 down
  sudo ifconfig bridge0 unplumb
  kextstat | grep "org.virtualbox.kext.VBoxUSB" > /dev/null 2>&1 \
  && sudo kextunload -b org.virtualbox.kext.VBoxUSB
  kextstat | grep "org.virtualbox.kext.VBoxNetFlt" > /dev/null 2>&1 \
  && sudo kextunload -b org.virtualbox.kext.VBoxNetFlt
  kextstat | grep "org.virtualbox.kext.VBoxNetAdp" > /dev/null 2>&1 \
  && sudo kextunload -b org.virtualbox.kext.VBoxNetAdp
  kextstat | grep "org.virtualbox.kext.VBoxDrv" > /dev/null 2>&1 && \
  sudo kextunload -b org.virtualbox.kext.VBoxDrv
}
 
load() {
  sudo kextload /Library/Extensions/VBoxDrv.kext -r /Library/Extensions/
  sudo kextload /Library/Extensions/VBoxNetFlt.kext -r /Library/Extensions/
  sudo kextload /Library/Extensions/VBoxNetAdp.kext -r /Library/Extensions/
  sudo kextload /Library/Extensions/VBoxUSB.kext -r /Library/Extensions/
  sudo ifconfig bridge0 plumb
  sudo ifconfig bridge0 inet 192.168.2.1 netmask 255.255.255.0 broadcast 192.168.2.255 up
}
 
case "$1" in
  unload|remove)
    unload
    ;;
  load)
    load
    ;;
  *|reload)
    unload
    load
    ;;
esac


the script was from this blog. I believed that the original script was from here, forums.virtualbox.org but this one is the improved & working one :)

วันพฤหัสบดี, สิงหาคม 18, 2554

Clonezilla problem: Clonzilla DVD boot media did not mount from DVD itself

Clonezilla problem: Clonzilla DVD boot media did not mount from DVD itself 
(always mount Flashdrive if there're Clonezilla boot media in both Flashdrive & CDROM)

    I have to remotely do Clonezilla imaging & restoration via iLO. There's no one standby to put in/put out the media from the server for me.

The situation was like this:

 1. have Clonezilla boot media in a Flashdrive, plugged in for making&keeping a clonezilla image.
2. have Clonzilla DVD boot media in a drive. There's a image which made by other and want to restore at this machine.


  • Reboot the machine 
  • Select to boot from DVD-ROM
  • It's booted
  • Select the default, 1st option
  • Clonezilla mount /home/partimag from a Flashdrive instead of a DVD.
How to solve:
  • When at Clonezilla boot option screen select to load Clonezilla to RAM
  • It's only load the program into a ramdisk.
  • then manually mount DVD-ROM to be /home/partimag
  • first; sudo -s to became root 
  • mount a dvd drive
    # mkdir -p /media/cdrom
    # mount /dev/sr0 /media/cdrom 
  • /home/partimag which Clonezilla will use to find their image files will be a symbolic link to /live/image//home/partimag (which is currently is a ram disk)
  • delete it
    # rm /home/partimag
  • create a new symbolic link point to mounted DVD disc instead
    # ln -s /media/cdrom/home/partimag /home/partimag
  • Done! now execute the Clonezilla program
    # clonezilla
  • When it ask the repository of images choose skip (the current /home/partimag)

reference:
Got an idea from
http://asecurepc.com/Ubuntu%20Tutorials/Clonezilla.html