A method for use in supporting migration of a virtual machine between hosts (155, 165), the method being for a first middlebox application of a first host: wherein the first middlebox application is one of a plurality of middlebox applications (225, 230), wherein the plurality of middlebox applications (225,230) implement a logical middlebox that provides a middlebox service to a logical network, and wherein the logical middlebox is one of a logical firewall, a logical load balancer, and a logical network address translator, wherein the logical network logically connects a plurality of VMs (250, 255) operating in a plurality of hosts to each other through a set of logical forwarding elements of the logical network, and wherein each host executes a managed forwarding element that implements the logical forwarding elements to connect a subset of the VMs operating in the first host to each other and to the VMs operating in other hosts; and the method comprising: providing the middlebox service to a virtual machine 'VM' operating in the first host, by performing the middlebox service on packets that are received from or destined for the VM, and wherein the first middlebox application receives the packets from a managed forwarding element executing on the first host; receiving a notification from a migration module before the VM migrates from the first host to a second host; identifying middlebox state information that relates to the VM; and supplying the identified middlebox state information to the migration module for the migration module to subsequently send the middlebox state information to the second host when the VM migrates to the second host, in order for a second middlebox application operating in the second host to continue providing the middlebox service to the VM when operating in the second host. wherein the first middlebox application is one of a plurality of middlebox applications (225, 230), wherein the plurality of middlebox applications (225,230) implement a logical middlebox that provides a middlebox service to a logical network, and wherein the logical middlebox is one of a logical firewall, a logical load balancer, and a logical network address translator, wherein the logical network logically connects a plurality of VMs (250, 255) operating in a plurality of hosts to each other through a set of logical forwarding elements of the logical network, and wherein each host executes a managed forwarding element that implements the logical forwarding elements to connect a subset of the VMs operating in the first host to each other and to the VMs operating in other hosts; and the method comprising: providing the middlebox service to a virtual machine 'VM' operating in the first host, by performing the middlebox service on packets that are received from or destined for the VM, and wherein the first middlebox application receives the packets from a managed forwarding element executing on the first host; receiving a notification from a migration module before the VM migrates from the first host to a second host; identifying middlebox state information that relates to the VM; and supplying the identified middlebox state information to the migration module for the migration module to subsequently send the middlebox state information to the second host when the VM migrates to the second host, in order for a second middlebox application operating in the second host to continue providing the middlebox service to the VM when operating in the second host. providing the middlebox service to a virtual machine 'VM' operating in the first host, by performing the middlebox service on packets that are received from or destined for the VM, and wherein the first middlebox application receives the packets from a managed forwarding element executing on the first host; receiving a notification from a migration module before the VM migrates from the first host to a second host; identifying middlebox state information that relates to the VM; and supplying the identified middlebox state information to the migration module for the migration module to subsequently send the middlebox state information to the second host when the VM migrates to the second host, in order for a second middlebox application operating in the second host to continue providing the middlebox service to the VM when operating in the second host.