There is still a problem. If I login automatically as user and inside the script I do this :
sudo iptables -A POSTROUTING -t nat -s 192.168.1.5 -j MASQUERADE
it asks me for the password (don't know why it didn't before) but I can't issue a password,because the script inside the vm should work automatically and should be hidden between the FreeBSD processes.