[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A light VM for testing Xen.



Thank you Charles.

I did:

$ sudo iptables --table nat -A POSTROUTING --out-interface enp0s3 -j MASQUERADE
$ sudo xl create /etc/xen/test.cfg
Parsing config from /etc/xen/test.cfg
$ sudo xl list
Name                                        ID   Mem VCPUs    State    Time(s)
Domain-0                                     0   875     2     r-----     735.4
test                                         2   128     1     -b----       3.5

And I can ping the IP address:

$ ping 10.0.0.60
PING 10.0.0.60 (10.0.0.60) 56(84) bytes of data.
64 bytes from 10.0.0.60: icmp_seq=1 ttl=64 time=0.555 ms
64 bytes from 10.0.0.60: icmp_seq=2 ttl=64 time=0.470 ms

After launched the VM:

$ sudo ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::8ffb:e4c9:5210:321d  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:fb:61:95  txqueuelen 1000  (Ethernet)
        RX packets 4284  bytes 1137645 (1.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2911  bytes 348994 (348.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 195  bytes 19277 (19.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 195  bytes 19277 (19.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


vif4.0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether fe:ff:ff:ff:ff:ff  txqueuelen 32  (Ethernet)
        RX packets 8  bytes 536 (536.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5  bytes 716 (716.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


xenbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.0.1  netmask 255.255.255.0  broadcast 10.0.0.255
        inet6 fe80::943e:b1ff:fe57:3da7  prefixlen 64  scopeid 0x20<link>
        ether fe:ff:ff:ff:ff:ff  txqueuelen 1000  (Ethernet)
        RX packets 29  bytes 1872 (1.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 71  bytes 10052 (10.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


But VM can't boot:
https://paste.ubuntu.com/p/HbNhbxX59Z/

Why?




On Tuesday, December 29, 2020, 01:44:47 PM GMT+3:30, Charles Gonçalves 
<charles.fg@xxxxxxxxx> wrote: 





Hey Jason, 

It's on  /etc/network/interfaces 

But, next time asking in this list, try first looking into the main references 
out there

https://wiki.xenproject.org/wiki/Xen_Project_Beginners_Guide
https://help.ubuntu.com/community/Xen


Atenciosamente,
Charles Ferreira Gonçalves 




On Tue, Dec 29, 2020 at 9:10 AM Jason Long <hack3rcon@xxxxxxxxx> wrote:
> Any idea?
> 
> 
> 
> 
> 
> 
> On Tuesday, December 29, 2020, 12:25:34 AM GMT+3:30, Jason Long 
> <hack3rcon@xxxxxxxxx> wrote: 
> 
> 
> 
> 
> 
> Thanks.
> Write:
> 
> auto xenbr0
> iface xenbr0 inet static
>         bridge_ports none
>         bridge_stp no
>         address 10.0.0.1 # or  192.168.1.1
>         netmask 255.255.255.0 # or 255.255.255.0
>         network 10.0.0.0 # 192.168.1.0
>         broadcast 10.0.0.255 # 192.168.1.255
> ...
> In which file?
> 
> 
> 
> 
> 
> 
> On Tuesday, December 29, 2020, 12:11:58 AM GMT+3:30, Charles Gonçalves 
> <charles.fg@xxxxxxxxx> wrote: 
> 
> 
> 
> 
> 
> Did you setup a bridge?
> 
> 
> Assuming a debian like dist:
> 
> # Xen bridge  - you can also use the 192.168.0.0
> auto xenbr0
> iface xenbr0 inet static
>         bridge_ports none
>         bridge_stp no
>         address 10.0.0.1 # or  192.168.1.1
>         netmask 255.255.255.0 # or 255.255.255.0
>         network 10.0.0.0 # 192.168.1.0
>         broadcast 10.0.0.255 # 192.168.1.255
> # if needed setup nameserver approprietaly
> # dns-nameserver 193.136.212.1
> 
> 
> then:
> 
> #sudo sysctl -w net.ipv4.ip_forward=1 also edit /etc/sysctl.conf
> sudo sysctl -w net.ipv4.ip_forward=1
> 
> sudo iptables -A FORWARD --in-interface xenbr0 -j ACCEPT
> sudo iptables --table nat -A POSTROUTING --out-interface XXXX -j MASQUERADE
> 
> sudo apt-get install iptables-persistent
> sudo /etc/init.d/iptables-persistent save
> sudo /etc/init.d/iptables-persistent reload
> 
> # Inside the Gest:
> ifconfig eth0 10.0.0.2 up
> route add default gw 10.0.0.1
> 
> 
> 
> 
> Atenciosamente,
> Charles Ferreira Gonçalves
> 
> 
> 
> On Mon, Dec 28, 2020 at 8:30 PM Jason Long <hack3rcon@xxxxxxxxx> wrote:
>>
>> Thank you.
>> I used "xl create /etc/xen/test.cfg" and got below error:
>>
>> $ sudo xl create /etc/xen/test.cfg
>> Parsing config from /etc/xen/test.cfg
>> libxl: error: libxl_exec.c:117:libxl_report_child_exitstatus: 
>> /etc/xen/scripts/vif-bridge online [176788] exited with error status 1
>> libxl: error: libxl_device.c:1286:device_hotplug_child_death_cb: script: 
>> Could not find bridge device xenbr0
>> libxl: error: libxl_create.c:1519:domcreate_attach_devices: Domain 3:unable 
>> to add vif devices
>> libxl: error: libxl_exec.c:117:libxl_report_child_exitstatus: 
>> /etc/xen/scripts/vif-bridge offline [176854] exited with error status 1
>> libxl: error: libxl_device.c:1286:device_hotplug_child_death_cb: script: 
>> Could not find bridge device xenbr0
>> libxl: error: libxl_domain.c:1034:libxl__destroy_domid: Domain 
>> 3:Non-existant domain
>> libxl: error: libxl_domain.c:993:domain_destroy_callback: Domain 3:Unable to 
>> destroy guest
>> libxl: error: libxl_domain.c:920:domain_destroy_cb: Domain 3:Destruction of 
>> domain failed
>>
>>
>> I changed config as below:
>>
>> vif=['10.0.0.60,script=vif-route']
>>
>> And added below lines to "/etc/xen/xend-config.sxp" file:
>> (network-script network-route)
>> (vif-script vif-route)
>>
>> Then commented out below line in "xl.conf" file:
>> vif.default.script="vif-route"
>>
>> But, I got below error:
>>
>> $ sudo xl create /etc/xen/test.cfg
>> Parsing config from /etc/xen/test.cfg
>> libxl: error: libxl_exec.c:117:libxl_report_child_exitstatus: 
>> /etc/xen/scripts/vif-route online [286618] exited with error status 1
>> libxl: error: libxl_device.c:1286:device_hotplug_child_death_cb: script: 
>> /etc/xen/scripts/vif-route failed; error detected.
>> libxl: error: libxl_create.c:1519:domcreate_attach_devices: Domain 5:unable 
>> to add vif devices
>> libxl: error: libxl_exec.c:117:libxl_report_child_exitstatus: 
>> /etc/xen/scripts/vif-route offline [286702] exited with error status 1
>> libxl: error: libxl_device.c:1286:device_hotplug_child_death_cb: script: 
>> /etc/xen/scripts/vif-route failed; error detected.
>> libxl: error: libxl_domain.c:1034:libxl__destroy_domid: Domain 
>> 5:Non-existant domain
>> libxl: error: libxl_domain.c:993:domain_destroy_callback: Domain 5:Unable to 
>> destroy guest
>> libxl: error: libxl_domain.c:920:domain_destroy_cb: Domain 5:Destruction of 
>> domain failed
>>
>> How can I solve it?
>>
>>
>>
>> On Monday, December 28, 2020, 04:32:06 PM GMT+3:30, Charles Gonçalves 
>> <charles.fg@xxxxxxxxx> wrote:
>>
>>
>>
>>
>>
>> I think that you need to read the documentation about setup the bridge, and 
>> the xl tool... Those are prerequisite for the commands that I send to you
>>
>> On Mon, Dec 28, 2020, 12:20 Jason Long <hack3rcon@xxxxxxxxx> wrote:
>> > Thank you.
>> > I did that command and logs are:
>> > https://paste.ubuntu.com/p/x2BpZfHSh7/
>> > https://paste.ubuntu.com/p/nVk5tXb2zk/
>> >
>> > Is everything OK? How can I launch my VM?
>> >
>> >
>> >
>> >
>> > On Monday, December 28, 2020, 12:30:50 AM GMT+3:30, Charles Gonçalves 
>> > <charles.fg@xxxxxxxxx> wrote:
>> >
>> >
>> >
>> >
>> >
>> > You can use xen-tools to create a small server
>> >
>> > In a Debian based distro:
>> >
>> > sudo apt install -y lvm2 debootstrap libconfig-inifiles-perl 
>> > libdata-validate-domain-perl libdata-validate-ip-perl 
>> > libdata-validate-uri-perl libfile-slurp-perl libfile-which-perl 
>> > libsort-versions-perl libterm-ui-perl libtext-template-perl openssh-client 
>> > perl debian-archive-keyring rinse libtest-notabs-perl
>> >
>> > git clone https://github.com/xen-tools/xen-tools.git
>> > cd xen-tools
>> > make install
>> >
>> > xen-create-image --hostname=test \
>> >  --ip=10.0.0.60 \
>> >  --broadcast=10.0.0.255 \
>> >  --gateway=10.0.0.1 \
>> >  --netmask=255.255.255.0 \
>> >  --memory=128mb \
>> >  --dir=/var/tpcv/xen_images \
>> >  --dist=trusty
>> >
>> >
>> > Obviously you should replace the values for your network environment
>> >
>> >
>> > On Sun, Dec 27, 2020, 20:23 Jason Long <hack3rcon@xxxxxxxxx> wrote:
>> >> Hello,
>> >> I want to test my Xen to be sure it's working properly. Any pre-build 
>> >> light VM?
>> >>
>> >> Thank you.
>> >>
>> >>
>> >
>> >
> 



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.