mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
# register image VBoxManage registerimage disk VDI/ubuntu-9.04.vdi -type normal # check registration VBoxManage showvdiinfo VDI/ubuntu-9.04.vdi # create VM VBoxManage createvm -name "ubuntu-9.04" -register # check vm creation VBoxManage list vms # update configuration VBoxManage modifyvm "ubuntu-9.04" -hda "VDI/ubuntu-9.04.vdi" -memory "1024MB" -acpi on -nic1 nat #si 64 bits # VBoxManage modifyvm ubuntu-9.04-64 --ostype Ubuntu_64 # VBoxManage modifyvm ubuntu-9.04-64 --hwvirtex on VBoxManage setextradata "ubuntu-9.04" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP VBoxManage setextradata "ubuntu-9.04" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 50001 VBoxManage setextradata "ubuntu-9.04" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22 # start vm VBoxHeadless -startvm "ubuntu-9.04" -p 50000 # install ssh support sudo apt-get install openssh-server # add office-srv-01 sflphone user ssh key in authorized_keys of vm ssh -o LogLevel=ERROR -o CheckHostIP=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 50001 sflphone@127.0.0.1 "mkdir ~/.ssh/" scp -o LogLevel=ERROR -o CheckHostIP=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -P 50001 /home/projects/sflphone/.ssh/id_dsa.pub sflphone@127.0.0.1:~/.ssh/authorized_keys ssh -o LogLevel=ERROR -o CheckHostIP=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 50001 sflphone@127.0.0.1 "chmod 0600 ~/.ssh/authorized_keys" # si nécessaire # scp -o LogLevel=ERROR -o CheckHostIP=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -P 50001 /home/projects/sflphone/build-system/git-buildpackage_0.4.45_all.deb sflphone@127.0.0.1: # update /etc/sudoers sflphone ALL = NOPASSWD: /sbin/shutdown, /usr/bin/apt-get, /usr/bin/dpkg # stop vm VBoxManage controlvm "ubuntu-9-04" poweroff